bpo-33895: Relase GIL while calling functions that acquire Windows loader lock (GH-7789)

LoadLibrary, GetProcAddress, FreeLibrary and GetModuleHandle acquire the system loader lock. Calling these while holding the GIL will cause a deadlock on the rare occasion that another thread is detaching and needs to destroy its thread state at the same time.
8 files changed