Thermodynamics of capillary adhesion between rough surfaces.