Use bson_destroy instead of bson_free, and fix memleak issue.