tcp_session: Code cleanup