Read as much as possible from stdin each time.

(Fixes bug for some applications that rely on keys that send multiple
bytes to receive it at once.)