readdir: return error instead of failing on invalid UTF-16
Fixes #15279

Signed-off-by: Peter Atashian <retep998@gmail.com>
auto merge of #17034 : retep998/rust/glob-fix, r=alexcrichton

Fixes #15279
Based on #13338