Implement result() function in MPI Work classes (#57168)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/57168
Implement result() for MPI which wasn't previously supported.
Some user rely on output args, however in future usecases (e.g. DDP comm hook) we need to return the result explicitly.
Test Plan: Imported from OSS
Reviewed By: mrshenli
Differential Revision: D28129125
Pulled By: agolynski
fbshipit-source-id: d6abcd2114163471c045043534a0a3377f2579b4