[Tests] Catch all exceptions when saving resource
[ArchiveManager] Use a safer method to save Resource

* Catch all exceptions
* Save to temp file first
Text fields filter out non-valid xml characters