Close temporary log files before removing them.