initialize _makefile_refs earlier so things don't blow up when close() is called in the constructor
diff --git a/Lib/ssl.py b/Lib/ssl.py
index 025aade..4b68284 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -483,6 +483,7 @@
                  server_hostname=None,
                  _context=None):
 
+        self._makefile_refs = 0
         if _context:
             self._context = _context
         else:
@@ -565,7 +566,6 @@
             except (OSError, ValueError):
                 self.close()
                 raise
-        self._makefile_refs = 0
 
     @property
     def context(self):