OSX compatibility for BSONWriter.
OSX compatibility for BSONWriter.