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>
Isn't it `result = db.engine.execute(table.select())` enough? Why do you need arguments `x` and `y`?