sw: port two switchHeaderFooter() calls to DocxTableExportContext

These two APIs do the same, except that the previous doesn't handle
nested calls, while the later does, as it stores its state on the stack.

The idea is that once all calls to the previous are eliminated, we can
get rid of it, reducing code duplication.

Change-Id: I0162f3ab475e306734412b39d7166c4f0bc6cd7f