Fixed bug in NetCDF save

Fixed a bug in NetCDF saving where comparing attributes containing an array caused a `ValueError`. This fix is identical to the fixes in #796 (indeed I would say that this fix slipped through that net).

Fixes #1137.