Bash: Fix handling of quoted HereDoc delimiters

Imported from upstream Scintilla bb784e214430498e91c9935bbc841c798629212f

Closes [bugs:#952]