Escape backslashes correctly

This fixes the quoting helpers so that `\` is escaped to `\\`.