std: iteratize str::is_utf16 & add tests.

Most of the tests are randomly generated with Python 3 and rely on it's
UTF-16be encoder/decoder being correct.
std: convert str::from_utf16 to an external iterator.

Fixes #12316.
str: provide lossy UTF-16 support.

This replaces the iterator with one that handles lone surrogates
gracefully and uses that to implement `from_utf16_lossy` which replaces
invalid `u16`s with U+FFFD.
std: decode even numbered non-BMP planes in the UTF-16 decoder.

Fixes #12318.
std: make str::from_utf16 return an Option.

The rest of the codebase is moving toward avoiding `fail!` so we do it
here too!
str: add a function for truncating a vector of u16 at NUL.

Many of the functions interacting with Windows APIs allocate a vector of
0's and do not retrieve a length directly from the API call, and so need
to be sure to remove the unmodified junk at the end of the vector.
auto merge of #12317 : huonw/rust/utf16, r=alexcrichton

Iterators! Use them (in `is_utf16`), create them (in `utf16_items`).

Handle errors gracefully (`from_utf16_lossy`) and `from_utf16` returning `Option<~str>` instead of failing.

Add a pile of tests.