Map KEY_ESC to ACTION_CANCEL

Fixes #2287