Finite-time thermodynamics and the gas-liquid phase transition.