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
31: D400 First line should end with '.', not 'y'
31: D205 Blank line missing between one-line summary and description
74: D400 First line should end with '.', not 'y'
74: D205 Blank line missing between one-line summary and description
123: D401 First line should be imperative: 'Return', not 'Returns'
148: D401 First line should be imperative: 'Return', not 'Returns'
148: D200 One-line docstring should not occupy 3 lines