Fix PoolWindow crash from thread_local (#22405)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/19394
See https://developercommunity.visualstudio.com/content/problem/124121/thread-local-variables-fail-to-be-initialized-when.html for context.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22405
Differential Revision: D16090822
Pulled By: ezyang
fbshipit-source-id: 9fdd2c272fa7723fb62b906336d2e2620411b12b