Escape a string using backslashes.