Virat Kohli notched his highest Test score to help India reach 255-5 against South Africa on day one in Johannesburg.