(Not an actual memory leak because the current clients of String8
never call set more than once for the same object. But you never
know who might use String8 in the future.)
Thanks to Julian Brost (who fixed the same bug in the connectbot project),
and thanks to Todd Musall for spotting the bug fix in the connectbot
tracker, and tried it out in Android Term.
In general we now support any IME trying to delete text to the left of
the cursor by calling InputConnector.deleteSurroundingText(). We generate
one "del" key event for each character of text that is to be deleted.
We don't support deleting text to the right of the cursor. If this
becomes an issue we can experiment with forward-cursor followed by del.