Thermally induced spin polarization of a two-dimensional electron gas