Add connection testing & retry logic to pool

Improved TestOnBorrow functionality during connection retrieval.