[loose parser] Improve recovery from unterminated strings and regexps