Use simple signal handlers at exit

Before exiting the program, we want to make sure to switch to a simpler signal handler. This is to avoid cases where a signal is thrown while parts of ROOT or the message logger have already been deallocated. This also avoids a problem happening in the threaded build were jemalloc causes a signal while it is still holding its internal lock and then the complex signal handler asks jemalloc for more memory and the program deadlocks.