[Python-Dev] Pass the Python thread state to internal C functions