Fix thread_local initializtion in C10 WarningHandler. (#34822)
Summary:
The Windows + MSVC-specific bug discussed here: https://github.com/pytorch/pytorch/issues/19394 and fixed here: https://github.com/pytorch/pytorch/issues/22405 still appears in C10's warning handler class. This results in a crash if a user attempts to run code which would print a warning when that code is running inside a thread created by a DLL. This PR applies a similar fix to that of https://github.com/pytorch/pytorch/issues/22405.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/34822
Test Plan:
* Tested locally by running CodecverseWorkbench Unity app with patched build.
* CI
Differential Revision: D20627971
Pulled By: HapeMask
fbshipit-source-id: 64dfca531ed7eebbe9e0ecac3d3d4d025c683883