[App] Fix segfault due to missing Py_Initialize in StringIDRefTest

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

Fixes #11878