Malloc warnings

Based on https://github.com/mongodb/mongo-ruby-driver/pull/464 without all of the extra crap.