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

r? anybody As per #4765