Rins wins Texas MotoGP title after Bagnaia crashes out of the lead