Fixes for Elixir within Cygwin

See #2597.
If we are explicitly checking for Cygwin, then it is ok to use specific cygwin functions.