Fix pybind11 warnings in python_rpc_handler.cpp (#27284)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/27284
The warnings related to usage of the deprecated != operator. Instead
of checking the member field on every function call, we can check it
once, on construction of PythonRpcHandler.
Test Plan: Imported from OSS
Differential Revision: D17808213
Pulled By: pietern
fbshipit-source-id: 022c8f77f266942c49c55b1729e62dbb06262d77