Add bound checks to utf16_to_utf8 am: 9b39ebe132 am: 05cd88ab69
am: f73212d5c6

Change-Id: Id826a00e8271c53f33ef27b0c89744a7072b1b27