services/mgmt/device/impl: refactor the glob test for re-use

Tests to show that permission lists correctly control access to logs,
stats and pprof data in children applications require validating the
presence of this information. Portions of the existing glob test can
be re-used for this purpose. This change hoists these portions into
separate utility functions.

Change-Id: I0f78f2b261bdc44dd384f4295b2496fb125a4629
2 files changed