bpo-38733: PyErr_Occurred() caller must hold the GIL (GH-17080)

bpo-3605, bpo-38733: Optimize _PyErr_Occurred(): remove "tstate ==
NULL" test.

Py_FatalError() no longer calls PyErr_Occurred() if called without
holding the GIL. So PyErr_Occurred() no longer has to support
tstate==NULL case.

_Py_CheckFunctionResult(): use directly _PyErr_Occurred() to avoid
explicit "!= NULL" test.
diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst
index a042c6e..cd6df00 100644
--- a/Doc/c-api/exceptions.rst
+++ b/Doc/c-api/exceptions.rst
@@ -374,6 +374,8 @@
    own a reference to the return value, so you do not need to :c:func:`Py_DECREF`
    it.
 
+   The caller must hold the GIL.
+
    .. note::
 
       Do not compare the return value to a specific exception; use