Added fix to ensure all HDF5 groups are closed if opened when string nda...

This fix ensures HDF5 groups are closed after writing string ndattributes.  The groups were not closed which resulted in references hanging around when trying to close the file.  Although another change was put in place to ensure the file was closed anyway, this fix stops these references from hanging around in the first place.