Fix detecting newer version of pkgng
repo: Fix missing package path when multiple versions of a package exist

Fixes:	#524
Remove typo
O_TTY_INIT is posix so not having it is a strangeness of dragonfly

Reported by:	jilles
Fix potential deferencement of null pointer
Fix potential dereferencement of NULL pointer
Plug a memory leak
Fix typo

Reported by:	matthew, marino
Fix in _pkg_available() for zsh completion

Fixes:		#526
Reported by:	Marwan Burelle
Initial implementation of repository conflicts.
Implement conflicts file output.
Fix bugs with conflicts detection logic.
Fix bugs in conflicts detection algorithm.
Add the cleanup of conflicts structures.
Cleanup temporary db as well.