Workaround a problem in recent libedit versions

Reinstall the readline handler when we are called in order to clear the
input line. Tested in a variety of versions by scn and myself.

Fixes #1531