Jorge Lorenzo has bid farewell to Yamaha in fitting style with an lights-to-flag victory in the final MotoGP race of 2016 at Valencia.