Avoid a crash in getPackageNameDuringConstruction()

sLatestResKey can be null, e.g. if the resource APIs are disabled.