Is there a way to trigger a 5V relay that is more robust than just feeding it with 5 V?
For critical systems, a failsafe circuit is used that has to be toggled continuously to activate the relay.  

The GPIO pin is toggled in the main software loop (typically) after doing all the normal processing.  If the loop stops, the toggling stops and the relay is deactivated.







simulate this circuit &ndash; Schematic created using CircuitLab

C1 blocks DC from the GPIO pin, C2 and R1 form a low pass RC filter that determines how long the output will stay active when the toggling stops (and removes the ripple from the AC component that is passed by C1 and rectified by D2).  

You can simulate this using the above schematic or recreate in LTSpice or similar to see how the circuit works.

The values of C1, C2 and R1 are dependent on the GPIO toggling frequency.