make python rpc handler to be singleton class (#25742)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/25742
python rpc handler right now is namespace + global variable, changed it to be singleton class as it can gurantee deterministic order of variable destruction. for namespace + global variable, we hit a process exit crash issue because global variables have dependencies and they are not destructed as expected
ghstack-source-id: 89809889
Test Plan: unit test passed
Differential Revision: D17097999
fbshipit-source-id: 5a5d003925dba1a7ea1caf3b7c28ff9e24c94a21