tcp: fix assert when closing

Reported by George Bosilca <bosilca@icl.utk.edu>