tcp: fix tcp_ack() performance problem