closes the netcdf file after informing the output groups
The file handle is released even if an output-group cleanup notification fails.