Sam Curran hit a quick-fire 35 as England set South Africa a near-impossible 466 runs to win the final Test and draw the series.