perf(server): stop rebuilding terminal history per chunk (#9703)
Append terminal history incrementally and materialize text for snapshots and coalesced disk writes.
Clear evicted line references without changing retained output.
Continues [#9357](https://github.com/pingdotgg/t3code/pull/9357). The original contribution and author credit are preserved.
The current line limit and wire format stay unchanged. A strict byte limit remains separate work.
Created with GPT-6 Astra (preview) in Codex.
Co-authored-by: will <will@moondiner.com>