Fix mingw compilation

The functions wcstombs_s (in zbeacon.c) and _vscprintf (in zsys.c) are not compatible with mingw (32-bit) compilers.

In the function 'wcstombs_s', a workaround is first get the required size to be allocated calling 'wcstombs' with size 0, allocate the memory, and then call 'wcstombs' with the allocated size.

For the function '_vscprintf', in mingw compilers a workaround is using 'vsnprintf' with pointer NULL and size 0 to get the required size.