Multiple fixes to test_c10d.py. (#25334)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/25334
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.
Test Plan: unit tests
Differential Revision: D17003555
fbshipit-source-id: 0e0429367fb6dae251b74e9f8b2baa67a48a0d22