Save log in case of interrupt (ctrl-c)