Marc Marquez survived a tense final race of the season in Valencia en route to clinching the MotoGP world title for the first time.