bpo-43268: Pass interp rather than tstate to internal functions (GH-24580)

Pass the current interpreter (interp) rather than the current Python
thread state (tstate) to internal functions which only use the
interpreter.

Modified functions:

* _PyXXX_Fini() and _PyXXX_ClearFreeList() functions
* _PyEval_SignalAsyncExc(), make_pending_calls()
* _PySys_GetObject(), sys_set_object(), sys_set_object_id(), sys_set_object_str()
* should_audit(), set_flags_from_config(), make_flags()
* _PyAtExit_Call()
* init_stdio_encoding()
* etc.
diff --git a/Objects/listobject.c b/Objects/listobject.c
index ca9df59..415f9a2 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -106,9 +106,9 @@ list_preallocate_exact(PyListObject *self, Py_ssize_t size)
 }
 
 void
-_PyList_ClearFreeList(PyThreadState *tstate)
+_PyList_ClearFreeList(PyInterpreterState *interp)
 {
-    struct _Py_list_state *state = &tstate->interp->list;
+    struct _Py_list_state *state = &interp->list;
     while (state->numfree) {
         PyListObject *op = state->free_list[--state->numfree];
         assert(PyList_CheckExact(op));
@@ -117,11 +117,11 @@ _PyList_ClearFreeList(PyThreadState *tstate)
 }
 
 void
-_PyList_Fini(PyThreadState *tstate)
+_PyList_Fini(PyInterpreterState *interp)
 {
-    _PyList_ClearFreeList(tstate);
+    _PyList_ClearFreeList(interp);
 #ifdef Py_DEBUG
-    struct _Py_list_state *state = &tstate->interp->list;
+    struct _Py_list_state *state = &interp->list;
     state->numfree = -1;
 #endif
 }