Tune up Windows snprintf() support

When we build with Visual Studio in debug mode, the invalid parameter handler
aborts the application (and offers to debug it) when n is 0. We want to
just return -1 instead (as calls with n == 0 are expected and happen in our
tests).
diff --git a/library/platform.c b/library/platform.c
index 23dba94..0606214 100644
--- a/library/platform.c
+++ b/library/platform.c
@@ -70,6 +70,10 @@
     int ret;
     va_list argp;
 
+    /* Avoid calling the invalid parameter handler by checking ourselves */
+    if( s == NULL || n == 0 || fmt == NULL )
+        return( -1 );
+
     va_start( argp, fmt );
     ret = _vsnprintf_s( s, n, _TRUNCATE, fmt, argp );
     va_end( argp );