bpo-34301: Add _PyInterpreterState_Get() helper function (GH-8592)

sys_setcheckinterval() now uses a local variable to parse arguments,
before writing into interp->check_interval.
diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
index f271193..73ae26d 100644
--- a/Python/dynload_shlib.c
+++ b/Python/dynload_shlib.c
@@ -91,7 +91,7 @@
         }
     }
 
-    dlopenflags = PyThreadState_GET()->interp->dlopenflags;
+    dlopenflags = _PyInterpreterState_Get()->dlopenflags;
 
     handle = dlopen(pathname, dlopenflags);