fixes BUG-54081: one DB connection leaked per each background thread
Each thread in charge of executing background processes leaked a DB connection which was not returned to the pool on finalization. Commit 2432bd6c (BUG-54029) prevents leaking connections handled by DAL, but it removed the code in charge of returning non-DAL ConnectionProvider connections.
This code has now been recovered keeping also the one dealing with DAL connections.