Replace deprecated AT_ERROR with TORCH_CHECK to reduce warnings in rpc
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/30794
Test Plan: Imported from OSS
Differential Revision: D18826311
Pulled By: mrshenli
fbshipit-source-id: bfd58d30f386bbe9535264b2afce4acbe7ac5b0e