fix to sqlalchemy 0.7.9
all_entity_classes: ensure we iterate on classes (not always the case with
sqlalchemy 0.8)