shell: Fix identification following escaped newlines

When a string contains an escaped newline, the internal state gets
out-of-sync with the source, leading to comments being incorrectly
identified as code.

Handle '\\' + newline specially in order to account for this.