support version locks

based on this upstream pull request
https://github.com/MongoEngine/mongoengine/pull/276
Where is the with_statement used?