Fix possible crash  when saving animation to non-existing file + loading malformed XML from skin file.

Also fix skeletal cache memory leak.