Fixed Bug #66412 readline_clear_history() with libedit causes segfault after #65714

Checking all libedit functions, this check is done in each functions (add_history,
read_history, write_history, ...) but is missing in clear_history.

Test coverage: readline_clear_history_001.phpt