stream: Change recursive _read() loop to a while loop