Replaces history item given by its position with contents of line. pos is zero-based.
readline/replace_history_item
replace_history_item