support version locks

based on this upstream pull request
https://github.com/MongoEngine/mongoengine/pull/276