PHP-1272 et al: Add missing bson_encode() tests and fix segfaults

 * https://jira.mongodb.org/browse/PHP-1272
 * https://jira.mongodb.org/browse/PHP-1273
 * https://jira.mongodb.org/browse/PHP-1277
I was only copying MongoDate's handling here (with a static buffer size of 9). I'm not sure that the 9th byte is necessary, as the string copying below takes a size and doesn't care about a null byte.

`RETURN_STRING()` ultimately calls [`ZVAL_STRINGL()`](http://lxr.php.net/xref/PHP_5_6/Zend/zend_API.h#585), which will end up using [`estrndup()`](http://lxr.php.net/xref/PHP_5_6/Zend/zend_alloc.c#2641) to copy exactly 8 bytes from the buffer and set a null byte in the 9th byte (which it adds to the new allocation).