Properly close sockets in remote_drivert