debugger: write history to a history file.