win32: a more correct snprintf() portability shim

Based on http://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010