TCP: fix case where writing was not immediate