Fix pkgdb_load_rdeps by reverting "Avoid deps full scan when loading dependencies."

This reverts commit cf47e2c24af23c8f278d9c502fe2923a42f23d33.

1. deps should be joined on p.id=d.package_id rather than origin.
   Otherwise no results are returned breaking pkg-query %r, pkg-autoremove,
   etc.
2. Restore uniqueid support [1]

Discussed with:	bapt [1]

Fixes #833
pkgdb_load_rdeps: Switch to a JOIN syntax