Fix logic for opening DB connections
Restore logic for opening DB connections in AtlRunQuery
that was modified in !68658 (merged) (presumably by accident). Fixes errors appearing when running AtlRunQuery.py
commands in SCT calibration loop jobs (see ATLSCTDAQ-193).