std: Change str::from_bytes to raise a condition on invalid input

r? @graydon As per #4765