fdo#71594: Fix for LO crash while saving of file.

    1] Libreoffice gets crashed while saving.

    2] This caused:
        "testCrashWhileSave.docx" file crashes on save
         Tested on Libreoffice 4.2

    Implementation:
    1] It crashes when we are trying to access cell number 2 from
       cells vector which contains only single cell. So put check
       for cell number which we are accessing and Number of cells
       in single row.
    2] As we are exporting Header and footer in between when we are
       exporting document.xml. In this case we are facing issue in
       table export for header and footer. Because flags for table
       is getting shared in both export.
       So we are switching between flags in between exporting
       "document.xml" and Header & footer
       export.

    After fix:
    1] No crash on save for "testCrashWhileSave.docx" and
       opens successfully on MS Office 2010
       Added Unit test case in export.

Conflicts:
	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
	https://gerrit.libreoffice.org/6676

Change-Id: Iefbf565f7b512d76ac68e9353e225edca425ef06