revert keyboard mode on exits and illegal instruction signals