Flush stdout after UpdateRects event