SI-8768 Process may block and never return value

PipedProcesses.runAndExitValue() have several issues, also discussed in #2379.

- Block when a process generated by `a.run()` quickly responded to `Process.exitValue()`.
- Leak `Thread` when `ProcessBuilder.run()` threw an error or `Process.exitValue()` interrupted.
- Leak `Process` when `ProcessBuilder.run()` threw an error.

This fixes these problems.