496f6b47fc
This is to properly handle the case where the interpreter wants to exit immediately, e.g. when `mjpython --version` is run. Currently, we call `PyGILState_Ensure` regardless of the result of `Py_InitializeFromConfig` resulting in a segfault, as in issue #2870. PiperOrigin-RevId: 869652555 Change-Id: I3a898279eb8aa25afbaece904cfdcc4fdcc92972