close files if not dirty