Fixed ScopedSession for SQLAlchemy 0.8+