A Thermodynamic Analysis of the Impact of Temperature on the Capillary Pressure in Porous Media