South Africa stonewall in difficult chase after Rahane ton