Synchronize access to resDirPackageNames

This fixes some cases where map entries get lost due to concurrent write
access. Thanks to @Tungstwenty for the analysis.
Retrieve resources package name just once

It's not expected to change, so we can save some computing and locking by
retrieving it only once during the initialization.
Fallback for resource package name

In the rare case that getTopLevelResources() is called from an unknown
(vendor-specific) entry point, fall back to the old approach of parsing
the APK in order to retrieve the package name.
Rename some private fields to follow naming conventions
Make XSharedPreferences.hasFileChanged() public

If modules perform expensive operations after a config change, this can
help to avoid them when nothing has changed.
Add XSharedPreferences.getFile()

Might be useful to check if the file is readable, log its path, ...
v53