redirector: migrate sql interface to sqlalchemy

* Replace run_sql queries with SQLAchemy query.

Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>
1: D200 One-line docstring should not occupy 3 lines
30: D400 First line should end with '.', not 'y'
30: D205 Blank line missing between one-line summary and description
70: D400 First line should end with '.', not 'y'
70: D205 Blank line missing between one-line summary and description
117: D401 First line should be imperative: 'Return', not 'Returns'
142: D401 First line should be imperative: 'Return', not 'Returns'
142: D200 One-line docstring should not occupy 3 lines