[server] avoid a possible race condition on _CnxSetPool.close()
The pool could become empty between time to check and time to use.
### Requirements for tests in various cubicweb/**/test directories. ###
## shared by several test folders
docutils
webtest
## cubicweb/test
Pygments
pycryptodomex
#fyzz XXX pip install fails
## cubicweb/devtools/test
flake8
## cubicweb/hooks/test
psycopg2-binary
## cubicweb/pyramid/test
pyramid >= 1.5.0
waitress >= 0.8.9
wsgicors >= 0.3
pyramid_multiauth
repoze.lru
## cubicweb/sobject/test