Fix lifetime of JITException binding (#106401)
Fix issues with new asserts introduced in 3.12 and pybind gil holding check on destructor.
See https://github.com/pybind/pybind11/pull/4769 for details on why this is a preferred solution rather than skipping the decref in all pybind object destructors.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/106401
Approved by: https://github.com/ezyang, https://github.com/malfet, https://github.com/Skylion007