Measuring device for measuring lengths or length differences, for checking the X dimension (piston protrusion)