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

Change-Id: Ibb67160142f8ccdf3f1d5c44d12efce392845c66