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

Change-Id: I15b9e020b389066973dab623a22b1d6eda981d02