Add support for caerctl history file.
Use strdup() where applicable in file.c.