upload-pack: strip refs before calling ref_is_hidden()