term.js: Consult application cursor (not keypad) mode for arrow keys

Patch by satoiha from here:
https://github.com/chjj/tty.js/pull/66/commits#issuecomment-13616867