Remove call into python API without GIL being held in c10d (#72928)
Summary:
Fix https://github.com/pytorch/pytorch/issues/26475
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72928
Reviewed By: mikaylagawarecki
Differential Revision: D34317697
Pulled By: albanD
fbshipit-source-id: e13efb98e8c6bf4cbc05181c028d68871a844bf7
(cherry picked from commit c0e0397688a6c56801c8efabad6401ae3c247e4f)