Sweet spot: JP Duminy's quick-fire 39 looked to have taken South Africa to the edge of victory