Add bound checks to utf16_to_utf8 am: bce11021b2 am: 008120497b
am: bab3334226

Change-Id: I6e4e399dfcf89f46d40a162c77462b889883f569