Fix history file writing.

Seems like it should work like this, no?  Otherwise, it's not really saving my history.