Thermodynamics of rock deformation by pressure solution