preserve back slashes to prevent json parsing errors

If you see the gerrit stream logs, you will see errors like

Expecting , delimiter: line 1 column 494 (char 493)

the patch ensures we preserve the back slashes properly when we read from the ssh stream and when we write to the file