Fix malformed database in case pkg update is interrupted

Ignore the malformed failure and rebuild the database from scratch.
Modify get_pragma() for it to be able to not emit errors if emission of
errors is not needed
Let dry_mode auto update the catalogs if -U is not passed

dry_mode will update the catalogs except if -U is not passed to install
or upgrade command or the the user has insufficient access to perform an
update of the database.

Fixes: #559
Turn autodeps on by default. This is needed to stop tracking indirect dependencies safely
Add a new function pkg_dep_lookup to avoid uselessly looping on deps
Only add missing deps if the dependency is not already listed

Reported by:	lme

While here remove the warning

Conflicts:
	libpkg/pkg_elf.c