rpm: use librpm's rpmvercmp

Bind and use rpmvercmp to compare versions of packages when sorting
them, instead of an own string-based comparison function.
rpm: isolate the "packages as NA RPM list" code

Just code motion, no functional change.
rpm: improve dnf invocation

Handle debug level and packager config.