Add a timeout argument to RPC shutdown() (#65425)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/65425
cc pietern mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse SciPioneer H-Huang gcramer23
Test Plan:
Imported from OSS
python3 test/distributed/rpc/test_tensorpipe_agent.py -v -k test_wait_all_workers_timeout
Reviewed By: mrshenli
Differential Revision: D31092483
Pulled By: dracifer
fbshipit-source-id: 5b5e9f20b1d6602cf8cde3772678f721dddf0d78