Fixed the MongoGridFSFile::write() method after an earlier broken fix.
Merged pull request #267