CAIRO — Egypt’s former grand mufti survived an attempt on his life in a western Cairo suburb when two masked gunmen opened fire as he was walking toward a mosque to hold Friday prayers, an Egyptian security official said. Sheikh Ali Gomaa was unharmed in the attack and the two attackers fled the scene outside