Robustify rpc_agent handlers with generic Future<T> (#31224)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/31224
If a future coming back to a rpc_agent server is satisfied with an
exception, ensure this information is propagated back over the wire.
ghstack-source-id: 95522418
Test Plan: buck test mode/dev-nosan caffe2/torch/fb/distributed/thriftRpcBackend/...
Differential Revision: D18979185
fbshipit-source-id: 99848ae805cc2d48948809a238f61a2e0ef234c9