Adding missing setting `state_.ptr()` and `hook_.ptr()` to `nullptr`. (#41537)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/41537
Explicitly setting PyObject* state_ and hook_ to nullptr to prevent py::object's dtor to decref on the PyObject again.
Reference PR [#40848](https://github.com/pytorch/pytorch/pull/40848).
ghstack-source-id: 107959254
Test Plan: `python test/distributed/test_c10d.py`
Reviewed By: zou3519
Differential Revision: D22573858
fbshipit-source-id: 84cc5949a370ffdb4ac3ca7a16a6f0f136563c1c