support version locks

Based on this up stream pull request
https://github.com/MongoEngine/mongoengine/pull/276