Rewrite ImageWriter's merging of String char[]s.

Simply sort the Strings and then look at two consecutive
Strings to find prefixes and duplicates. Avoid unnecessary
memory allocations.

Change-Id: I996306ed4b31e61f9f0def8f3bcce71eb01c9265
1 file changed