STS: Use TrimRight() with the CStringW YCbCr matrix value

This removes trailing newline, space and tab characters.
While working around simple mistakes, this should not let pure
garbage past.
TextFile: Only fallback to ASCII/ANSI parsing if no UTF-8 BOM was present.

The presence of an UTF-8 BOM should indicate that the file actually is UTF-8,
and one invalid character should not be considered as a reason to think
otherwise.

Backport of MPC-HC commit 8bb9070
TextFile: Properly recover after an invalid UTF-8 character.

bValid was never properly set to TRUE after an invalid character,
which was no problem before because UTF-8 parsing was aborted. However,
if parsing is to simply skip invalid characters, this case needs to be
handled properly.

Backport of MPC-HC commit 962bbef
TextFile: Add support for U+10000-U+10FFFF UTF-8 encoded characters
RTS: Fixed handling of WrapStyle flag again

Fixes wrapstyle == 3

Backport of MPC-HC commit 89ab140
DSUtil: HackFix the I420/YUY2 to RGB conversion using Kasumi

This really shouldn't get used anywhere, but since Lord has
been able to replicate it, this goes in.

Originally committed as 0778f9e for the 2013-05-30 release
Subtitles: Catch certain memory allocation failures to fix a crash

This is in no way a complete solution, but this seems to fix a
crash with a certain sample on 32bit systems.

Also fixes xy_malloc to not fail within itself in case of allocation
failure.
Change output filenames to what Aegisub wants