history: put the output through the pager in interactive mode

(Ideally, the behaviour of git could be implemented: pipe the input
through a pager iff the length is > window size and in interactive
mode).

Closes #1076.