Improve control over subprocesses.

It's not trivial to figure out when all submodules finished execution.
Instead keeping track of circuits and streams, let the submodules signal
that they are done by sending the sentinel (None,None) over the IPC
queue.