Expect POSIX compatible vsnprintf.

Detect when the return value indicates the required buffer size and use that buffer size.
Or if the return value is simply -1, guess another (bigger) buffer size.