Changed the mode argument for all the popen() calls to be just "w",
instead of "wb". According to the Linux manual page posix implementations
must accept only "r" or "w", no other characters. And you will get a
return error with EINVAL with modern version og glibc if this is not
the case.
It may well be that this is fine for CYGWIN too, someone needs to
test and report.
Calls to fopen and the like are unchanged, and they certainly do
support the "b" mode specifier.