SI-7350 Prevent resource leaks in PipedProcesses.runAndExitValue()
Translate to jUnit test cases
Merge pull request #3920 from rubyu/issue/7350

SI-7350 Prevent resource leaks in PipedProcesses.runAndExitValue()