std: convert str::from_utf16 to an external iterator.

Fixes #12316.