Don't notify JS until both stdout has been closed and all subprocesses have terminated