PHP-868: Inline php_mongo_is_valid_id() and use const arg