Reverted test code for ExitThread and ThreadTerminate.
Put config back in the header because the header uses config options.
Added some late cleanup checks to the hook_is_enabled function to workaround Windows auto-magic thread cleanup.