Reject failed UTF-16 sizing queries before allocating the UTF-8 result and preserve terminating-NUL accounting. Validation: nine host-stub cases with 16-bit wchar_t; native Windows execution remains unverified.
Signed-off-by: Onur Özkan <work@onurozkan.dev>