Use readline functionality if available

The command line prompt is implemented using the fgets function, which
doesn't add any editing functionality to the prompt. It would be nice if
the program could optionally be built with support for a readline like
library.

Allow the command line prompt to be implemented using readline or a
compatible library.

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