PyModule_AddObject steals a reference.  Fix all of the double calls to it by adding a Py_INCREF.  Also, some other assorted hacks which probably shouldn't be necessary but are at the moment.
diff --git a/src/crypto/x509ext.c b/src/crypto/x509ext.c
index 90ef543..426741c 100644
--- a/src/crypto/x509ext.c
+++ b/src/crypto/x509ext.c
@@ -308,6 +308,9 @@
         return 0;
     }
 
+    /* PyModule_AddObject steals a reference.
+     */
+    Py_INCREF((PyObject *)&crypto_X509Extension_Type);
     if (PyModule_AddObject(module, "X509Extension",
                            (PyObject *)&crypto_X509Extension_Type) != 0) {
         return 0;