Reset the state before requesting the entire document

This allows an error in a layer name to contribute to the errors.txt even if the name was set before asset generation was enabled (only then we also generate errors.txt). It also better fits the idea of requestEntireDocument().

It seems a bit messy, though. I'm open to suggestions - we may want more refactoring anyway, and so could defer to such a time.