redirector: migrate sql interface to sqlalchemy

* Replace run_sql queries with SQLAchemy query.

Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>
keep `parameters=None,` see http://pythonconquerstheuniverse.wordpress.com/category/python-gotchas/