Fix a bug that was preventing the REPL to correctly respect the history when
an input hook was set. Patch by Pablo Galindo