Fixed regression on #255: close index/phys as well while bailing out.