Backport of r64212
Issue #1683: prevent forking from interfering in threading storage.
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index 9d223d5..352e739 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -693,5 +693,6 @@
 	main_thread = PyThread_get_thread_ident();
 	main_pid = getpid();
 	_PyImport_ReInitLock();
+	PyThread_ReInitTLS();
 #endif
 }