tcp_session: Implement handshake stage