[FIX] Category: Only dump cache if loaded

This also removes the 'loaded' variable as it's basically defined
if both the attributes are present. This also set the content to
'loaded' after loading the file.

Change-Id: I788166b45f5644a23d6d3dad858f8d32b6e16e38
Merge "[FIX] Category: Only dump cache if loaded"