Fix exception thrown by converter when data ends in text

Conversions usually end in a close tag so this hasn't been a problem
before, but the mini-conversion we do in onCopy may not be balanced.

Change-Id: Ia2db29f116ca84ee886b4c5cafd4ac45cd926b79
(cherry picked from commit caa05f33158973b6e127c7d949e3457738526964)
Merge "Fix exception thrown by converter when data ends in text" into wmf/1.22wmf17