ZF-7045: Refactor building of the count query into its own method in the DbSelect adapter


The construction of the COUNT query in Paginator's DbSelect adapter should be moved into its own method, called getCountSelect(). This makes the code more readable and the generated queries easier to test.


Resolved in r16146 and merged to release-1.8 in r16147