Fix windows crash trying to log a bad sql query longer than the buffer, changed VSPRINTF from vsprintf_s to vsnprintf