Check history support

Add checks to avoid errors when the GNU readline module is not installed.