ensure xkeys are unique when upgrading from a version before 2.0pre5
define file mode consts at the top of the script so they're defined when apps are updated on load due to upgrade/downgrade
serialize app installs on updateAll() to avoid race conditions
Merge pull request #266 from mykmelez/ensure-xkeys-unique

ensure xkeys are unique and serialize app installs after starting simulator to avoid race conditions