Close the file before starting to free TFile's resources