Do not try to loop on post_patterns (FORCE_POST) if none are found

Reported by:	lme
Actually it should return a boolean
Move all remote repo manipulations to pkgdb_repo.

As all db manipulations are the subject of pkgdb code it is a good
idea to move repository manipulations to pkgdb base. Hence, cleanup
sqlite code from pkg_repo and add pkgdb_repo.c module. This also
allows to perform incremental updates eventually by calling
pkgdb_repo routines.
Insert manifest digest to repo db.

The manifestdigest field was forgotten in previous commit, so add
it now.
Add utility to iterate over all origins in repo.

To implement incremental updates it is required to have an ability
to iterate over all packages in repository. And counting that
we have sorted origins in digest file we should also sort origins
while iterating.

Mark pkgdb_it_new function as non-static.
Use binary search in populate_pkg.

This function is called for each package request, but it uses linear
iterate over all possible columns for each column in sqlite reply.
Using sorted columns list allows us to use efficient binary search,
therefore add a constraint of columns array being sorted by name
and use bsearch instead of iterations.
Add preliminiar incremental update function.

Add initial logic of incremental update that does not include
real repository update but describes the overall update logic as
well as provides some digest related utilities.
Use bsearch in manifest parsing as well.

To optimize package manifest parsing speed it is a good idea to use
binary search for package fields matching. We can perform up to 31
strcmp when using the old scheme. With bsearch we guarantee to have
no more than log2(N) strcmp calls, therefore bsearch is a good choice
in this case.

Sort manifest keys accordingly (can easily be done by sort -k2
command)