agent: poll instead of wait

We're doing this poll loop instead of docker.waitContainer() because we
saw the agent hang forever on waitContainer after the socket got into a
weird half-open state where the kernel (netstat/lsof) would only show
one end of the connection and restarting docker would not close the
socket.

¯\\_(ツ)_/¯