HAL: Increase safety during program termination.
HAL: Increase safety during program termination.

- Add an atexit hook to set global and watchdog to nullptr.
- Add checks to HAL functions for these nullptrs (also good checks if they
are called prior to HALInitialize).

Change-Id: I138657e8279ed9289648a91c91091ea6a1eb5dcc

RAR1741/wpilib,333fred/allwpilib,JLLeitschuh/allwpilib,PatrickPenguinTurtle/allwpilib,PatrickPenguinTurtle/allwpilib,JLLeitschuh/allwpilib,RAR1741/wpilib,PeterMitrano/allwpilib,JLLeitschuh/allwpilib,PatrickPenguinTurtle/allwpilib,robotdotnet/allwpilib,JLLeitschuh/allwpilib,JLLeitschuh/allwpilib,RAR1741/wpilib,PatrickPenguinTurtle/allwpilib,333fred/allwpilib,RAR1741/wpilib,PeterMitrano/allwpilib,JLLeitschuh/allwpilib,PeterMitrano/allwpilib,PeterMitrano/allwpilib,PeterMitrano/allwpilib,PeterMitrano/allwpilib,RAR1741/wpilib,PatrickPenguinTurtle/allwpilib,333fred/allwpilib,robotdotnet/allwpilib,RAR1741/wpilib,PatrickPenguinTurtle/allwpilib,robotdotnet/allwpilib,JLLeitschuh/allwpilib,PatrickPenguinTurtle/allwpilib,PeterMitrano/allwpilib,robotdotnet/allwpilib,333fred/allwpilib,333fred/allwpilib,robotdotnet/allwpilib,RAR1741/wpilib,333fred/allwpilib,robotdotnet/allwpilib