Second round of eliminating allocations in the MongoDB driver. See #633.