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>
286: D290 White spaces around docstring should be trimmed.
299: D290 White spaces around docstring should be trimmed.