Multiple fixes to test_c10d.py. (#25441)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/25441
1) There was a bug in https://github.com/pytorch/pytorch/pull/25012, where the
tests which needed to be skipped for return code checking was incorrect.
2) Added proper setup and teardown for the nccl_error tests.
3) Ensure AssertionError is not ignored for tests that skip return code
checking.
ghstack-source-id: 89317660
Test Plan: unit tests
Differential Revision: D17125824
fbshipit-source-id: 317ec39942b93e40ab847246b3a5129919ba2ac4