Word: Always create nodes in the correct document

Under some circumstances, XML nodes were being created from one
document, and then inserted into another. This included when translating
content inside footnotes and endnotes (which live in separate XML files
in the .docx package), and also during pre-processing of a HTML file to
detect bookmarks during a put operation.

The reason this was problematic is that memory management of nodes is
the responsibility of their containing document. This problem was only
discovered after making some (soon-to-be-committed) API changes that
resulted in translated HTML document being used after the source
documents from which it had been created were freed. When running some
of the tests under valgrind, an attempt to serialise the HTML files lead
to access of the freed memory.

DFInsertBefore, which is also called by related functions such as
DFAppendChild and DFCreateChildElement, now includes an assertion check
that catches cases where the node being inserted is from a different
document to its parent.