LaTeX writer: Protect graphics in headers.

Graphics in `\section`/`\subsection` etc titles need to be `\protect`ed.

This adds a state value and manually turns it on before every invocation
of `sectionHeader` and manually turns it off after. Using a writer value
and applying `local` would probably be cleaner, but this fits with the
current style.
LaTeX writer: Test for protecting images in header.
LaTeX template: Added \VerbatimFootnotes if there is verbatim in notes.

Fixes a bug when there is verbatim inside notes.
Closes #1616.
Updated tests for #1616 change.
Docx writer: Renumber header and footer relationships to avoid collisions.

We previously took the old relationship names of the headers and footer in
secptr. That led to collisions. We now make a map of availabl names in the
relationships file, and then rename in secptr.
Merge from upstream.
Update templates (LaTeX change).