crt: Don't run TLS destructors for the main thread if exiting via _exit or ExitProcess

For these cases, the TLS destructors are normally executed by
the callback set up by _register_thread_local_exe_atexit_callback,
but if this is bypassed (if exiting via _exit or ExitProcess),
skip these callbacks.

This differs from what MSVC does, but matches what the C++ standard
says should happen.

Signed-off-by: Martin Storsjö <martin@martin.st>
1 file changed