issue 9786 Native TLS support for pthreads
PyThread_create_key now has a failure mode that the applicatino can detect.
diff --git a/Python/pystate.c b/Python/pystate.c
index 77534fc..d5d98b0 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -569,6 +569,8 @@
 {
     assert(i && t); /* must init with valid states */
     autoTLSkey = PyThread_create_key();
+    if (autoTLSkey == -1)
+        Py_FatalError("Could not allocate TLS entry");
     autoInterpreterState = i;
     assert(PyThread_get_key_value(autoTLSkey) == NULL);
     assert(t->gilstate_counter == 0);