debugger: also exit when the repl emits 'exit'

Fixes #5631