Make PyErr_Occurred return NULL if there is no current thread.  Previously it
would Py_FatalError, which called PyErr_Occurred, resulting in a semi-infinite
recursion.

Fixes issue 3605.
3 files changed