Add bound checks to utf16_to_utf8
am: 1deedbacc3

Change-Id: I5004728668382feeafcc6fa6155b3169d8240664