SI-8768 Process may block and never return value

PipedProcesses.runAndExitValue() may block and never returns a value. Fixed by moving two lines `currentSource put None` and `currentSink put None` to the finally clause. 
Added a test to verify the behavior.