South Africa’s ruling African National Congress is on the brink of losing its parliamentary majority for the first time after an election that has brought a stunning drop in support for the party that led its country out of apartheid under Nelson Mandela.