Proteas hold nerve in thriller