Properly escape backslash in sync post body (updated)

If the body of a post contained a backslash, it would be treated as an escape character when written to res.write('\') and corrupts the contents of the body. This patch properly escapes the backslash character.

Update: removed extra period from previous pull request