Fix undefined behavior in std::ascii

Closes https://github.com/rust-lang/rust/issues/18314