Add bound checks to utf16_to_utf8 am: bce11021b2 am: 008120497b am: bab3334226
am: ff58d7c918  -s ours

Change-Id: I31000817d4f99c215277d580948a20194176d53e