Simplify pkg rquery to make the work in one pass

This should reduce a lot of overhead and make jail creation faster.

Ticket:	#2457
Merge:	releng/9.1.0