py/repl: Fix handling of unmatched brackets and unfinished quotes.
py/repl: Fix handling of unmatched brackets and unfinished quotes.

Before this patch:

    >>> print(')
    ... ')
    Traceback (most recent call last):
      File "<stdin>", line 1
    SyntaxError: invalid syntax

After this patch:

    >>> print(')
    Traceback (most recent call last):
      File "<stdin>", line 1
    SyntaxError: invalid syntax

This matches CPython and prevents getting stuck in REPL continuation when a
1-quote is unmatched.

dmazzella/micropython,kerneltask/micropython,trezor/micropython,adafruit/circuitpython,tobbad/micropython,kerneltask/micropython,adafruit/micropython,kerneltask/micropython,henriknelson/micropython,MrSurly/micropython,selste/micropython,MrSurly/micropython,trezor/micropython,pramasoul/micropython,bvernoux/micropython,tralamazza/micropython,tralamazza/micropython,adafruit/micropython,adafruit/micropython,tobbad/micropython,MrSurly/micropython,bvernoux/micropython,adafruit/micropython,pozetroninc/micropython,tralamazza/micropython,adafruit/circuitpython,MrSurly/micropython,selste/micropython,pfalcon/micropython,adafruit/circuitpython,kerneltask/micropython,dmazzella/micropython,swegener/micropython,dmazzella/micropython,pramasoul/micropython,henriknelson/micropython,bvernoux/micropython,pozetroninc/micropython,swegener/micropython,pozetroninc/micropython,henriknelson/micropython,adafruit/circuitpython,swegener/micropython,selste/micropython,pfalcon/micropython,pfalcon/micropython,adafruit/circuitpython,tobbad/micropython,pfalcon/micropython,tobbad/micropython,pramasoul/micropython,bvernoux/micropython,dmazzella/micropython,trezor/micropython,pfalcon/micropython,tobbad/micropython,pramasoul/micropython,swegener/micropython,kerneltask/micropython,pramasoul/micropython,pozetroninc/micropython,tralamazza/micropython,swegener/micropython,selste/micropython,selste/micropython,adafruit/micropython,trezor/micropython,henriknelson/micropython,pozetroninc/micropython,adafruit/circuitpython,bvernoux/micropython,MrSurly/micropython,trezor/micropython,henriknelson/micropython