Keep track of deleted extensions to remove them from the FITS file when using the optimized writing.
cc @laure.piqueras @roland.bacon