[utils] Fixed issue in clearing QueryCache
When trying to add an item in a full QueryCache, the cache tries to make room.
It tries to list and remove non-permanent items with a transient counter (number
of times it has been requested). However, there is a pathological case where
items could be non-permanent but still not have a transient counter because they
were added, but never requested. In some cases, the full cache could be flushed,
including the permanent items.
This changeset attempts to fix this issue by only dropping the non-permanent
items that did not hav a transient counter.
### Requirements for tests in various cubicweb/**/test directories. ###
## shared by several test folders
cubicweb-card == 0.5.8
docutils
Twisted < 16.0.0
webtest
## cubicweb/test
Pygments
mock
#fyzz XXX pip install fails
cubicweb-file == 1.18.0
cubicweb-localperms == 0.3.2
cubicweb-tag == 1.8.3
## cubicweb/devtools/test
flake8
## cubicweb/hooks/test
psycopg2
## cubicweb/pyramid/test
pyramid >= 1.5.0
waitress >= 0.8.9
wsgicors >= 0.3
pyramid_multiauth
## cubicweb/sobject/test
cubicweb-comment == 1.12.2