Joe Root took four wickets and Mark Wood impressed as England left South Africa on the brink of defeat in Port Elizabeth