CAY-1855  Iterated and paginated queries must print result counts

preliminary refactring - removing misplaced connection closing code

git-svn-id: https://svn.apache.org/repos/asf/cayenne/main/trunk@1507813 13f79535-47bb-0310-9956-ffa450edef68