Add utility to iterate over all origins in repo.

To implement incremental updates it is required to have an ability
to iterate over all packages in repository. And counting that
we have sorted origins in digest file we should also sort origins
while iterating.

Mark pkgdb_it_new function as non-static.