The ratings agency warned that South Africa’s public finances could be affected if the government reacts to the riots by easing fiscal policy