Add generic join unit tests (#61786)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61786
This adds unit tests for the generic join context manager.
```
gpurun python test/distributed/algorithms/test_join.py
```
Test Plan: Imported from OSS
Reviewed By: mrshenli
Differential Revision: D29746646
Pulled By: andwgu
fbshipit-source-id: 2933d85783c2225574c4b77bfb90064690c6e668