PHP-868: Check string pointer and length in php_mongo_is_valid_id()