lib/package_remove.c: fix a memleak.
xbps-pkgdb: rework symlinks checks to avoid false positives with -r.