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>
150: D202 No blank lines allowed *after* function docstring, found 1
194: D202 No blank lines allowed *after* function docstring, found 1
194: D400 First line should end with '.', not 't'
194: D205 Blank line missing between one-line summary and description