fix double deref on socket close