Windows FileStore skip timeout if the file path is invalid (#103247)
On Windows in FileStore if the path to the file to be created is not valid then it will get stuck there trying to create the file until the timeout is reached.
This PR checks if the path is invalid and if it is then it will leave the loop instantly.
Fixes #48475
Pull Request resolved: https://github.com/pytorch/pytorch/pull/103247
Approved by: https://github.com/fduwjj, https://github.com/kit1980