Keep track of unterminated literal expressions.

Also gives the scanner the ability to confirm whether the last token is unterminated, which is useful for the classifier.
I know this is wrong, this is related to #1209.