Ronnie O'Sullivan produced his 171st World Championship century to move within a frame of victory over Ding Junhui