Avoid dead-locking when no more data is available
Handle terminal mousing events in win_sleep