Correctly triggering IRC socket close events