redirector: migrate sql interface to sqlalchemy

* Replace run_sql queries with SQLAchemy query.

Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>
26: D400 First line should end with '.', not 'y'
26: D205 Blank line missing between one-line summary and description
65: D400 First line should end with '.', not 'y'
65: D205 Blank line missing between one-line summary and description