resolved: do not run loop twice
This doesn't matter much, but let's just do the loop once and allocate
the populate the result set on the fly. If we find an error, it'll get
cleaned up automatically.
Related: #1746857
patch_name: 0246-resolved-do-not-run-loop-twice.patch
present_in_specfile: true
location_in_specfile: 246
squash_commits: true