Fixes issue #3826 and #4791:
Have SocketIO objects update their reference count in the underlying
socket object on close() so that the underlying socket object is
closed immediately when the last user is done rather than at an
unknown later time when garbage collection can do it.
diff --git a/Misc/NEWS b/Misc/NEWS
index 42637dd..442cc1f 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -111,6 +111,10 @@
 Library
 -------
 
+- Issue #3826 and #4791: The socket module now closes the underlying socket
+  appropriately when it is being used via socket.makefile() objects
+  rather than delaying the close by waiting for garbage collection to do it.
+
 - Issue #3860: GzipFile and BZ2File now support the context manager protocol.
 
 - Issue #4867: Fixed a crash in ctypes when passing a string to a