lib/standard/stream: Changed implementation of read to better respect its documentation