Extracted some logic to utils_default.cpp in order to make platform specific overriding easier

Test: manual - could install and remove an app. As this is
refactoring there is no need for automated tests.

Change-Id: Ia9321de6699c69fbb7cfa9cf43edde102d56d532
4 files changed