Fix integer overflow in utf{16,32}_to_utf8_length am: c17624db31
am: 3065de2c86  -s ours

Change-Id: I36daba675eb298da120301c6c5ebf7f853bc704e