Test items_available = items returned when limit is large.
Test no duplicate UUIDs are returned by collections.list.
Count distinct records for items_available, not rows generated by permission join.
Really check for duplicate items returned, instead of just calling a
variable unique_uuids.
Merge branch 'master' into 2209-correct-items-available
Fix counting results in test case (count != size for an ActiveRelation).
Merge branch '2209-correct-items-available'

closes #2209