close log file before exit