tdb2: use counters to decide when to coalesce records.