Do not pass NULL filename to stat in cf_stat
Fix leaks in XML editing