Use a temporary file during ReducerTest (#39004)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/37558
Use a temporary file instead of `/dev/null` in `ReducerTest`, to prevent the chance of unintended deletion when running as root. It seemed that there were no strong side-effects (running time?) by fixing it at the test level, compared to other solutions that involved modifying the behaviour of `FileStore` (for example, adding an optional flag to avoid auto-deleting the file upon destruction).
Please note this is my first contribution - I have done my best to read the contributing guide and checked for duplicate PRs with no luck, but apologies in advance for any oversights and lack of familiarity with the procedures.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39004
Differential Revision: D21721966
Pulled By: mrshenli
fbshipit-source-id: 76fb81600fa08a91c35d0eb9a5aab179f5371422