Distributed read/write locking based on MongoDB, designed to make GridFS safe for concurrent access