Thermal Evolution of the Envelope of SN 1987A