Capillary condensation in atomic scale friction: how water acts like a glue