EZP-21723: Optimize search count for pagerfanta adapter a bit.

See @andrerom's comment on #558:

> This could be optimized as the totalCount will be generated by the
> slice as well, so if we want this to only generate one query this
> could have reused existing result if there already was one. However if
> PagerFanta calls this function before getSlice then it would have been
> needed to be done differently.

Note that it's just a tiny optimization since we cannot predict in which
order getNbResults() and getSlice() are called. This optim assumes that
getSlice() is called first.