I'm not sure I understand this--why is the HDU header being built up 'after' the table has already been written to disk?  ISTM this doesn't do anything.