What is the well-known mechanism to make sure the grounding connection always works?
You have ground fault monitoring relays that only activate the appliance when the voltage on all lines is within expected window. They can also make sure the phase sequence is correct. 

These are specialty devices for industrial equipment. Often found in rental machinery since three phase motors switch direction if you change the phase sequence (swap two wires).

For residential use you can use ground fault current interrupter (gfci), also known as residual current detectors (rcd).
These devices fit in your breaker panel and trip when the current of live and neutral is not equal.
They interrupt current when you touch it and accidentally create a path to ground.

They mandatory in some parts of the world.