address issue #17894 with the close method. I tested against test_socket_cpy and urllib2