Add test for tcp drain closing.

Test is currently failing even though according to the logs the socket
is being closed at the right spot.