Add isatty() compatibility code for running under Cygwin
Add isatty() compatibility code for running under Cygwin

...when compiling using the Windows native C library.

Why it is needed:
WIN32 isatty() gives a wrong result (for Cygwin) on Cygwin's
pseudo-ttys, because they are implemented as Windows pipes.
The added code is compatibility layer, originally sent to the Cygwin
discussion group by Corinna Vinschen, Cygwin Project Co-Leader.
See: https://www.cygwin.com/ml/cygwin/2012-11/msg00214.html

A later amending of this commit message:
Also fix a problem on _WIN32 that classifies as a tty the NUL device
(will be added later).

Due to a compilation error
error C2081: 'FILE_INFORMATION_CLASSX': name in formal parameter list illegal
the added code is ifdef'ed out, and provided here for reference to the
original code before it is fixed.

ampli/link-grammar,ampli/link-grammar,opencog/link-grammar,opencog/link-grammar,opencog/link-grammar,opencog/link-grammar,ampli/link-grammar,opencog/link-grammar,opencog/link-grammar,linas/link-grammar,linas/link-grammar,ampli/link-grammar,linas/link-grammar,linas/link-grammar,ampli/link-grammar,ampli/link-grammar,opencog/link-grammar,linas/link-grammar,ampli/link-grammar,linas/link-grammar,ampli/link-grammar,opencog/link-grammar,opencog/link-grammar,ampli/link-grammar,linas/link-grammar,linas/link-grammar,linas/link-grammar