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

Change-Id: Idba9a2ff0f2365fdc1f6c60c46d1c617c552728f