inveniocfg: fix PostgreSQL test connection

* Use a SQLAlchemy's independent query to test connection.

* Create a dialect depending procedure to initially test the db.

Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>
31:1: F401 'InternalError' imported but unused
31:1: F401 'ProgrammingError' imported but unused
31:1: F401 'DataError' imported but unused
31:1: F401 'NotSupportedError' imported but unused
31:1: F401 'IntegrityError' imported but unused
31:1: F401 'InterfaceError' imported but unused
31:1: F401 'OperationalError' imported but unused
31:1: F401 'DatabaseError' imported but unused
49:1: F401 'deserialize_via_marshal' imported but unused
49:1: F401 'serialize_via_marshal' imported but unused
58: D203 Expected 1 blank line *before* class docstring, found 0
58: D204 Expected 1 blank line *after* class docstring, found 0
65: D202 No blank lines allowed *after* function docstring, found 1
172:9: F841 local variable 'dbhost' is assigned to but never used
189: D400 First line should end with '.', not 'L'
189: D205 Blank line missing between one-line summary and description
203:1: E302 expected 2 blank lines, found 1
203: D400 First line should end with '.', not 'r'
203: D205 Blank line missing between one-line summary and description
223: D400 First line should end with '.', not 'n'
223: D205 Blank line missing between one-line summary and description
223: D208 Docstring is over-indented
239:22: E261 at least two spaces before inline comment
253:1: E302 expected 2 blank lines, found 1
253: D400 First line should end with '.', not 'a'
253: D205 Blank line missing between one-line summary and description
253: D208 Docstring is over-indented
261:27: E261 at least two spaces before inline comment
284:1: E302 expected 2 blank lines, found 1
284: D205 Blank line missing between one-line summary and description
300:1: E302 expected 2 blank lines, found 1
300: D401 First line should be imperative: 'Escape', not 'Escapes'
311:9: F841 local variable 'dbhost' is assigned to but never used
316:1: E302 expected 2 blank lines, found 1
316: D103 Docstring missing
345:69: E502 the backslash is redundant between brackets