Fix integer overflow in utf{16,32}_to_utf8_length am: f0a43dede9
am: 33abf90994

Change-Id: I5509908232bd838a229c1c2f3a35e0960a741288