Deal with cases when ESC is pressed and when all uncommitted text is
deleted with multiple Backspace presses.