Revert "Don't close datasets, groups, and attributes from closed files"

This reverts commit cbbf24dad67bff4a8911019b68804142c4e5a6df.