Problem: when the TUI output buffer is filled during a redraw, flushing
it to the terminal also causes `CSI ? 2026 l` to be emitted, which ends
synchronized output. This causes visible flickering with large redraws.
Solution: track whether a synchronized output is currently active, and
only emit the end sequence on the final flush.