Close client socket on error