Fixed the MongoGridFSFile::write() method after an earlier broken fix.