Win32: UTF-8 <-> WCHAR conversion overhaul

* This change consolidates conversion functions for character encodings (UTF-8 to and from wide characters) on Windows into a single place. Each direction has variants for using provided buffers, receiving a new buffer, or using fixed-size `MAX_PATH` buffers (which have `typedef`s).
* All conversions from one encoding to another are now checked instead of trusting blindly that they succeeded.
* Some functions which use the Win32 API have been rewritten to improve their correctness with respect to failed system calls or bounds checks.
* A new value for the maximum size (in bytes) of a UTF-8 Windows path is proposed (259 * 3 + 1).
* A missing escape character in a test case was found and fixed.