The PyObject desctructor requires an initialized interpreter, otherwise PyGILState_Ensure crashes. Fixes #11878