Clean up Modified UTF-8 encoding.

The function `String::GetUtfLength()` is used exclusively in
`String::ToModifiedUtf8()`, so rename it to better reflect
the intent, namely to `String::GetModifiedUtf8Length().
Similarly, rename the function `CountUtf8Bytes()` used only
in the above function to `CountModifiedUtf8BytesInUtf16()`.
Rename a copy of the function used in tests.

Reimplement `CountModifiedUtf8Bytes()` and the renamed
`CountModifiedUtf8BytesInUtf16()` with equivalent code using
the helper template function `ConvertUtf16ToUtf8<>()` and
flag the fact that despite the name referencing Modified
UTF-8, the generated encoding can contain 4-byte sequences.

Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: m libctstiagent
Bug: 192935764
Change-Id: I942a3b77ee3af0194ee8315e0631ec217a0af67d
11 files changed