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