Mohamed Salah scored again as 10-man Egypt secured their spot in the knock-out rounds of the Africa Cup of Nations with a 1-0 win against South Africa.