Updates to proc_open pipe handling
Created by: kabadi
Changed the descriptorspec for the stderr pipe to 'w' (it was 'a' but this seems only applicable when streaming to a file, not a pipe) Reversed the order in which the stderr and stdout pipes are read to get around an apparent bug in the proc_open