Fix a bug in UTF-16/32 detection.

Add a missing buffer length check. 

The upstream bug :

While I'm at it, I'm adding two patches that I forgot to include 
in the previous check-in ( )

TEST=SyzyASAN does not complain any more after this version of ICU is rolled.

Review URL:

git-svn-id: 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
5 files changed