Reduced memory footprint of UTF-16 conversion

Minor changes to StringToUTF8(). Replaced new[]/delete[] with
malloc()/free() for chars throughout in order to take advantage of
realloc(), which makes it unnecessary to allocate a separate temporary
array for accumulating code points and then loop through the Unicode
characters a second time (while still conserving memory). This
simplification also improves conversion performance by 10-15%.