Measuring tool integrity in machine tools