redirector: migrate sql interface to sqlalchemy

* Replace run_sql queries with SQLAchemy query.

Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>
1: D400 First line should end with '.', not 't'
1: D205 Blank line missing between one-line summary and description
33: D103 Docstring missing
49: D400 First line should end with '.', not ':'
49: D205 Blank line missing between one-line summary and description
61: D400 First line should end with '.', not 'e'
61: D205 Blank line missing between one-line summary and description
73: D103 Docstring missing
150: D202 No blank lines allowed *after* function docstring, found 1