tcp: improve socket cleanup

After closing the fd, set tconn->fd to 0