Fix resource-only topic detection #1600

Resource-only and cross set results were retrieved for each processed
topic, thus if an earlier map marked topic as resource-only, it was not
unmarked later. Retrieving resource-only set after all files have been
processed will yield correct results.

Cherry-picked from 24137f1b399a04d442513455862a5fcf3507753b.