add a replacement API for PyCObject, PyCapsule #5630

All stdlib modules with C-APIs now use this.

Patch by Larry Hastings
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 3c9dd61..b400057 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -71,6 +71,8 @@
 /* Include symbols from _socket module */
 #include "socketmodule.h"
 
+static PySocketModule_APIObject PySocketModule;
+
 #if defined(HAVE_POLL_H)
 #include <poll.h>
 #elif defined(HAVE_SYS_POLL_H)
@@ -1626,6 +1628,7 @@
 PyInit__ssl(void)
 {
 	PyObject *m, *d;
+        PySocketModule_APIObject *socket_api;
 
 	if (PyType_Ready(&PySSL_Type) < 0)
 		return NULL;
@@ -1636,8 +1639,10 @@
 	d = PyModule_GetDict(m);
 
 	/* Load _socket module and its C API */
-	if (PySocketModule_ImportModuleAndAPI())
+        socket_api = PySocketModule_ImportModuleAndAPI();
+	if (!socket_api)
 		return NULL;
+        PySocketModule = *socket_api;
 
 	/* Init OpenSSL */
 	SSL_load_error_strings();