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 'e'
31: D205 Blank line missing between one-line summary and description
71: D400 First line should end with '.', not 'y'
71: D205 Blank line missing between one-line summary and description
120: D401 First line should be imperative: 'Return', not 'Returns'
120: D301 Use r""" if any backslashes in a docstring
144: D401 First line should be imperative: 'Return', not 'Returns'
144: D200 One-line docstring should not occupy 3 lines