Use runtime resolution for AttachConsole/GetConsoleWindow to make mingw happy