TCP client passes basic tests, works in riemann-bench

Fixes some disconnect and test bugs.