Improve detecting if a handle is a console on Windows.

Use GetConsoleMode. If it succeeds (returns non-zero) then the handle is a
console. If it fails (returns zero) then the handle is not a console.

The old check, (GetFileType (handle) == FILE_TYPE_CHAR) assumes that a handle
of type FILE_TYPE_CHAR is a console. This falsely reports a handle directed to
NUL as a console.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=12752
Merge pull request #707 from LHCGreg/12752-windows_nul_isredirected

Improve detecting if a handle is a console on Windows.