[12570] CMake: Create config.h for windows only when needed

Also, don't use a prepared file but instead just generate it.

This has no effect for Visual Studio, as we still have our hack in place
in the ACE sources which directly include config-win32.h