use pkg_printf
Rename ENV to PKG_ENV to not conflict with sh(1)'s ENV
Remove stray printf in PKG_CONFIG_KVLIST handling
More pkg_printf() cleanup.
Sort out some usages of const and restrict

const struct pkg *p   -- p is a pointer to constant data.
struct pkg * const p  -- p is a constant pointer

However, it's pretty obvious to the compiler when the pointer is constant,
so there's not much to be gained from that.

More insteresting is:

struct pkg * restrict p

-or-

const struct pkg * restrict p -- no other pointer in scope will access
      	     	   	      	 the struct that p points to

This can permit some very significant optimisation.