Initialize thread_id to 0 in unthreaded build. Fixes #770247.
diff --git a/Python/pystate.c b/Python/pystate.c
index e8cb547..5793612 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -144,7 +144,11 @@
 		tstate->tick_counter = 0;
 		tstate->gilstate_counter = 0;
 		tstate->async_exc = NULL;
+#ifdef WITH_THREAD
 		tstate->thread_id = PyThread_get_thread_ident();
+#else
+		tstate->thread_id = 0;
+#endif
 
 		tstate->dict = NULL;