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

This was a problem when compiling on Cygwin with gcc 4.8.
Merge pull request #224 from PetterS/cygwinfix

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