fix issue with circular refs (with o2m and m2o fks from both classes) in util.sqlalchemy