[c-index-test] Fix JSON string quoting
Previously, c-index-test assumed that all it could write strings to the JSON output directly. This breaks if any strings contain double-quotes or backslashes, which can occur for C++ string literals.
Ensure that strings are properly quoted for JSON, and add a test for string literals.
@swift-ci please test llvm
@swift-ci please smoke test
@swift-ci please test llvm
@swift-ci please smoke test
Tests are passing on macOS and Linux, but looks like there's a pre-existing failure on Windows. I think this code is good to merge, but happy to make any changes you'd like.