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.