If a client writes to the PTY "too slow", we often end up flashing the
screen. This could for example be caused by a client first erasing a
line, then we render that frame, followed by the client updating the
just-erased line. When we render _that_ frame, it will be perceived as
a flash.
Mitigate this by trying to read client data again, after finishing
processing one batch, but before rendering.
To avoid hanging on client output (and never rendering anything),
limit this to at most 3 iterations. This may have to be tweaked.