Check return result from Py_InitModule*().  This API can fail.

Probably should be backported.
diff --git a/Modules/resource.c b/Modules/resource.c
index c5bec79..7cbd2c9 100644
--- a/Modules/resource.c
+++ b/Modules/resource.c
@@ -234,6 +234,8 @@
 
 	/* Create the module and add the functions */
 	m = Py_InitModule("resource", resource_methods);
+	if (m == NULL)
+		return;
 
 	/* Add some symbolic constants to the module */
 	if (ResourceError == NULL) {