Request exclusive access when crashing via fatal()
When loading the configuration fails, there might be already other tasks running and calling OpenSSL library functions. The OpenSSL on_exit handler is called when exiting the main process and there's a timing race between the on_exit function that destroys OpenSSL allocated resources (threads, locks, ...) and other tasks accessing the very same resources leading to a crash in the system threading library. Therefore, the fatal() function needs to request exlusive access to the task manager to finish the already running tasks and exit only when no other tasks are running.
Showing with 14 additions and 5 deletions