The unfurling of a rainbow flag at an open-air rock concert in Cairo was a rare public show of solidarity with gay and transgender people in the Arab world’s most populous nation. The backlash has been fierce: Dozens have been arrested and put on trial, spreading panic in the embattled community.