Fix ICU glue for uloc_toLanguageTag.

There were several issues :
- ICU does not set the output param UErrorCode* to U_ZERO_ERROR
  when an API call is successful, so we need to clear it before every
  API call.
- ICU sets the error code to U_BUFFER_OVERFLOW_ERROR (and sets the
  output length to the required size) if the input buffer is too
  small.
- ICU sets the error code to U_STRING_NOT_TERMINATED_WARNING when
  the input buffer is one character too short.

bug: 13414549
bug: 13412659
Change-Id: I3e23ea507a540f37ab1c14a60afe801bca286554
2 files changed