Flask-SqlAlchemy closes a session