[BUGFIX] 1st level cache for ``QueryResult::count()``
Counting the results of the ``QueryResultInterface`` proxy that is
returned by Repository finder methods always executed a ``COUNT query``,
even if the results have been fetched or counted already.
With this patch the number of results is cached as soon as the
result is initialized and/or counted once.
Releases: master, 3.0, 2.3, 2.2, 2.1