close Streams
Finalize both backends:
CSV: close writers, globally sort & rewrite FUN/VAR (aligned), finalize TOP blocks.
Parquet: sort & write FUN/VAR, finalize TOP blocks from its own buffers.
Backends are decoupled and maintain independent state.
Parameters
model
Dataset context to resolve output paths and buffers.