Cygwin pty support for emacs etc. from Meadow (http://www.meadowy.org/meadow/log/trunk/nt/fakecygpty.c)