Make transaction CFs correctly limited to the correct queues

In 74e6f62, the $queues{...}++ line was moved from above the "next
unless ..." line to below it.  This changes the meaning of %queues, from
"the set of queues of the tickets listed" to "the set of queues of
tickets _changed_."  This causes the transaction CF list to be broader
than expected in most cases.

Make the transaction CFs limited based on $seen_queues, which is
computed based on all tickets listed, and remove the no-longer-used
%queues.
Merge branch '4.0/transaction-cf-limit-on-bulk-update' into 4.0-trunk