CachingConnectionFactory proceeds to physicalClose in case of logicalClose exceptions

Issue: SPR-12148
(cherry picked from commit 82f8b43)
Polishing