Fix a bug in escaped control character handling. Roll back changes to buffer if sudo_json_add_value() fails.