Add lines to history if it is available

Readline like libraries usually include the ability to store previous
lines which the user can quickly reuse. We already check for the
presence of this in the configure program. Use it if it is available.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>