attach to parent console and provide stdout/stderr for GUI app. in Windows

This is former #700 applied to up-to-date master.