being more defensive: don't try to write a history-file if no home-dir is defined