Three-time champion Mark Selby survives a scare to beat world number 67 Zhao Xintong 10-7 and reach the second round of the World Championship.