The riots were the deadliest since the end of South Africa’s racist system of apartheid, or white-minority rule, in 1994.