tsocket: make sure we delete the fd event before calling close()