LEDGE-218: validate connection cached connection before usage, close it
& attempt to reconnect if necessary.
LEDGE-218: make exceptions in setApplicationName non-fatal
LEDGE-218: tread carefully around setClientInfo("ApplicationName")
because we've seen strange low-level exceptions from Postgres here.
attempt to recover when opening connection fails, or the connection
fails the validation attempt right after opening. Number of retires is
hard-coded at 1.