Fix fileno not always present. fileno(stdout) = 1.

This was a problem when compiling on Cygwin with gcc 4.8.