Destroy IRC socket properly on error