Fix deadlock in agent representation

Deadlock when try to Schedule task "foo", and receive two updates one after another from the agent:
<- update {"foo": stateRunning}
<- update {"foo": stateFailed}

Block when try to signal "outstanding" containers.

Fix: do not stop listening on channel till it's not closed.

@peterbourgon @jmyounker @stuartnelson3
In the new test.