Fix minor bugs.

If the cache directory has not been created yet, do not attempt to
iterate through it and delete files. Fix typo that was clearing
AvatarImageResourceId incorrectly in CardData.

Change-Id: I8de8435b96833b3ec841a6e4e55b0e7c6208eae4
Do not list files twice when cleaning cache.

Change-Id: Ie13cfc80aac4b48cfbb01da85baa13bac3517b95
Fix FEED_PUBLISH permission check bug.

For some reason, when responding to a PACKAGE_ADDED Broadcast to pick up
a new extension, PackageInfo would not be populated with permissions.
Fix this by using checkPermission() instead, which returns the correct
value.

Change-Id: I04535039a38a045ad1a405fe60ec8ccb6e782784
Fix NPE

Change-Id: I1ea39257859d0418d73da4f71212ae47befcc5cc
Synchronize calls using mImages in CardData to avoid Concurrent modifications exception

Change-Id: Id6c785e6361d5e96ab8f9df8e506f018490dc52b