Read output streams before calling WaitForExit() to avoid a deadlock for
packages with many dependencies.