Disconnect streams in the inverse order they are connected
Otherwise there is a time window where the worker process
can no longer read its input, but can still complain about
that on its output stream. This leads to unwanted user-facing
error logging for something that is completely normal.