Test against drain's internal state rather than checking for closed socket.

For some extremely mysterious reason, closing one side of this socket
refuses to close the other in the tests, though manual tests with
netcat confirm that it's in fact being closed.