UpdateWrapper tracked progress using len(line) which counts characters,
but the progress bar total is set to the file size in bytes. For multi-byte
encodings like UTF-16-LE (2 bytes per character) the bar would only reach
50% before the file finished. Now encode each line/chunk back to bytes using
the stream's encoding to report the correct byte count.
Queries returning duplicate column names - e.g. joins between tables
sharing column names - silently lost values because rows were built
with dict(zip(keys, row)), where the last duplicate wins.
Later occurrences are now renamed with a numeric suffix: id, id
becomes id, id_2 - skipping any suffix that would collide with a
real column in the same query.
The new utils.dedupe_keys() helper transforms the key list once per
query, so the per-row dict construction is unchanged and there is no
measurable performance impact.
Applied in Database.query() (including the PRAGMA and RETURNING
paths), Table.rows_where(), Table.search() and the CLI's JSON output.
CSV, TSV and table output keep the original duplicate headers.
Closes#624