escape \ in matlab strings

I tried running some matlab code in a Matlab cell magic, the code contains
a string like "test\" and the magic fails with a json error since this is not properly escaped.
This seems like the simplest solution that resolves the problem but I did not carefully test it
in other situations.