Removing socket error event listener