finsh: refactor the control key handling

We split the history handling form the key handling. So we could handle
the direction key even if the history is disabled.