database/sql: fix logic for pulling a Conn from DB
The logic for pulling a database connection from the DB pool should
proceed as follows: attempt to pull either a cached connection or
new connection N times in a loop. If each connection results
in a bad connection, then create a new connection (no cache).
Previously pulling a Conn from the pool, the last step also
looked at the cache, rather then always creating a new connection.