Fix config renderer, use `json_encode` instead of `add_slashes`.

fixes #1038