Handle python frame is empty in GetPythonFrames (#83643)
Fixes https://github.com/pytorch/xla/issues/3900 and https://github.com/pytorch/xla/issues/3795 for pytorch/xla when `XLA_IR_DEBUG=1`
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83643
Approved by: https://github.com/Krovatkin