Inductor: fix crash when indexing an empty tensor by invalid index (#95046)
This pr is for #94830. Aligned the behavior with eager.
Reference: https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/native/TensorAdvancedIndexing.cpp#L550-L558
Pull Request resolved: https://github.com/pytorch/pytorch/pull/95046
Approved by: https://github.com/jgong5, https://github.com/jansel