Fix CharsetEncoder.replaceWith, and simplify our implementation.

All I wanted to do was remove some more Get/Release Critical calls,
but I stumbled across some code that couldn't possibly be right.

Bug: 2663177
Change-Id: I82e240fe27ff9fcfe7f036c2d7708a9e55afa3ee
9 files changed