redirector: migrate sql interface to sqlalchemy

* Replace run_sql queries with SQLAchemy query.

Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>
28: D400 First line should end with '.', not 'y'
28: D205 Blank line missing between one-line summary and description
68: D400 First line should end with '.', not 'y'
68: D205 Blank line missing between one-line summary and description