Fix socket close callback