Typo

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
Add extra check in wait loop that is reset after loop is exited

This is required for decoder reset() calls, since there, the loop needs
to be exited immediately, but without permanently setting flushing to TRUE

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>