[inductor] Fix a multi-gpu context error (#97398)
Summary: The problem only appears when we enable multi-gpu test.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/97398
Approved by: https://github.com/ngimel, https://github.com/shunting314