South Africa withdrew an asylum order after violent anti-migrant riots rocked parts of Johannesburg and Durban.