Fix a bug in UTF-16/32 detection.

Add a missing buffer length check. 

The upstream bug : http://bugs.icu-project.org/trac/ticket/10318

While I'm at it, I'm adding two patches that I forgot to include 
in the previous check-in (http://crrev.com/121777 http://crrev.com/158118 )

BUG=275803
TEST=SyzyASAN does not complain any more after this version of ICU is rolled.
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/22911033

git-svn-id: http://src.chromium.org/svn/trunk/deps/third_party/icu46@219032 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
5 files changed