Improved FD_CLOSE scheme for sockets