Fix trailing surrogate validation.

The macro `U16_IS_SURROGATE_LEAD()` assumes that the input
is a surrogate without checking that assumption. Use the
`U16_IS_TRAIL()` macro instead to correctly validate the
trailing surrogate in `CharsetUtils.toUtf8Bytes()`.

Test: atest CtsLibcoreTestCases:libcore.java.lang.StringTest
Bug: 193891113
Change-Id: Ib70d5a5b42c885ede3bf0e3bc087383c979f1f60
1 file changed