Direct nanomechanical measurement of layer thickness and compressibility of smectic liquid crystals