Jorge Lorenzo produced a masterful display to smash his own lap record and claim pole for what will be his final appearance for Yamaha.