Rohit Sharma steered India to a six-wicket win over South Africa at Southampton.