The exact mass gap of the Gross-Neveu model (I). The thermodynamic Bethe ansatz