lineedit: add support for history saving on exit