fix(engine/persistence): OptimisticLocking only for HasRevision

make sure optimistic locking check is only performed for entities
providing a revision.

related to #CAM-1719