use Win32 CreateProcess() rather than mingw spawnv() (#4531)
Fix build on Windows
Refactor gcc.c, pulling out the reusable code