>From time to time during a long run, I close the netCDF files and reopen them later. This of course updates everything, including the unlimited dimension. If you have no other reason to close the file, the ncsync/NCSNC functions (Synchronize an open netCDF file to disk) may interest you. This doesn't repair your existing files, but speaks to your last paragraph regarding prevention of this problem.
netcdfgroup
archives: