More windows io fixes.

- Use stdout instead of stderr so msvc doesn't think the build failed
- Add a definition of snprintf