Fix integer overflow in utf{16,32}_to_utf8_length am: 47efc676c8
am: 6e2bf89dc7

Change-Id: I6b5786e20b0df1729453d21e05dbd926aabbf56d