CIfo: fix an incompatible call to WriteFile()

That was producing a crash in windows versions prior to 8.

Fixes #3091