Unify return values from Wels*Snprintf and simplify calling code

Make sure Wels*Snprintf never returns negative values (which it only used to do on windows), and simplify the calling code using this information.