Fixed CJSON::encode's handling of resources

Now a resource is encoded as `null`, which is better than having malformed JSON resulting from the default behavior