Fix/uniformize ReadPipeToArray() implementation for Linux & Mac

 - wrong error handling leading to reset buffer