[LT] Move device lock in LazyGraphExecutor to a later place
Summary: cherry-picking https://github.com/pytorch/xla/pull/3457
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76974
Approved by: https://github.com/wconstab, https://github.com/JackCaoG