Reset libxml flags when done loading XML

Also pulling in a patched version of htmlmaid that does the same thing.

Fixes #716 (probably).