Fixed blocking on reading app output without processing other events.