Release GIL for RPC pybind functions. (#33610)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/33610
Our pybind definitions for several RPC functions didn't release GIL
once we were processing stuff in C++.
This PR adds asserts that we release GIL appropriately and adds
py::gil_scoped_release and py::gil_scoped_acquire in the appropriate places.
ghstack-source-id: 99066749
Test Plan: waitforbuildbot
Differential Revision: D20025847
fbshipit-source-id: 57a778cba0336cf87352b07c89bbfb9254c4bdd7