Mohamed Salah scored again as 10-man Egypt secured top spot in Group B of the Africa Cup of Nations with a 1-0 win against South Africa.