tcp: compute seq_end in tcp_input