safety check on xml, would lead to segv when applying changes
expand lock scope when expiring entries from the cache

make sure we lock the file node details in each case when running the scan
for expiry. It could trigger a remove if the expire value has not been set