Close files opened by lock_file() before unlinking.