Surface energy of liquids isolated in narrow capillaries