add in code to handle ftruncate of index.   tricky because of
the case where you are doing a non-zero truncate of a file that
you have open for writing (and are writing to).   if you've
already got index records on disk, they'll get rewritten and
we need to resync the open write index file handle.   modified
trunc_edit_nz to do this by have it swap the filehandles if
we update.