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 'd'
1: D205 Blank line missing between one-line summary and description
30: D400 First line should end with '.', not ','
30: D205 Blank line missing between one-line summary and description