Protect cursorPosition(x, y) against malformed sequences

Malformed "set cursor position" sequences were blowing the terminal.