Escape control characters in JSON output

The JSON spec (http://www.json.org) says that control characters are not allowed in JSON, but Rust currently does not escape them. This PR escapes ASCII control characters in JSON output.
Thanks for this! Unfortunately this unfortunately would be pretty expensive. Could you rewrite this to not use an allocation here?