Prevent writing empty config.xml on parse errors.

This happened if you enter invalid characters for XML nodes, for example "namespace/module" as observer name for an event configuration.