Correct ERR event handling in readline.