South Africa’s BRICS friends and its minerals export boom are giving Pretoria breathing room to withstand American pressure.