Fix pkg which returns bogus non-zero exit status on success

Reported by:	mandree
Fixed:	#657
Do not test a null key
Test all return of ucl_object_key
Workaround a bug on arm and ia64
Update pkg.conf with a new example section and add deprecation where needed
Get rid of yaml informations
Add a pkg-config(8) man page
libpkg/Makefile: Remove NO_MAN directives

The two libpkg man pages are on the pkg-plist and they are meant to be
installed.  Apparently there is a bug in FreeBSD's /usr/share/mk that
ignored these directives.  Their presence was caught on DragonFly which
correctly did not install them, thus failing in DEVELOPER_MODE.
Add support for PORTSDIR values other than the default /usr/ports

Currently /usr/ports prefix is hardcoded into pkg. If MAKE_ARGS has
PKG_PORTSDIR defined, it will build pkg with the value of that variable
instead.  e.g. MAKE_ARGS+= PKG_PORTSDIR=${PORTSDIR}

That MAKE_ARGS definition will be added to the ports makefile to
properly support non-standard PORTSDIRs.
Make man pages reflect the PORTSDIR pkg was built with
Sync libucl (this fixes: #649)
Fix pkg register complaining about shared libraries not found

Fixes: #656
Do not resume a jailed or chrooted pkg(8) upgrade

Fixes: #662
use a new macro NELEM() to count the number of element in a static sized array.
Added a Coccinelle test for NELEM.

  Introduce a new directory in tests for .cocci files.

  "Coccinelle is a program matching and transformation engine which
  provides the language SmPL (Semantic Patch Language) for specifying
  desired matches and transformations in C code."
  - see http://coccinelle.lip6.fr/
Use NELEM() where appropriate.
Added cocci scripts

  A README is provided in tests/cocci with a very short usage intro.
  Most of the scripts in tests/cocci where taken from the examples found
  in the Coccinelle website. Scripts in tests/cocci/pkg were adapted or
  writting for pkg.
badzero.cocci fixes.
pkg_jobs.c: Removed a useless test detected by notnull.cocci.
Typos in the unchecked_malloc cocci file.