check if the thread is finalizing after retaking the GIL
avoid a deadlock with the interpreter head lock and the GIL during finalization
expect the correct platform-dependent linesep
merge 3.2
merge 3.3
remove extra call to tstate_delete_common (merge artifact)
revert tstate_delete_common, since it's pretty much wrong