Escape newlines in heredocs with backslashes