src: emulate snprintf() on windows

snprintf() is a c99-ism and that's something msvc supports only
sparingly.  Fixes a Windows-only build error that was introduced
in commit 559ca71.

Fixes #58.