HHVM fixes v1

First of all, amazing work! I was about to start writing a native HHVM mongo extension until someone pointed me to your repo, this will save a lot of time!

I'm working on HHVM compatibility with your repo, in other words I'm trying to get it to pass all ``hphp/test/slow/ext_mongo`` tests. The following commits are the initial version of those attempts.

This fixes about 20 to 30 tests. I should've tagged which commit fixed what test but I totally forgot. I will try to do tag them in the future.

If you have any questions, let me know.