Add null check when list directory

This change protect getPlatformFileListForPrefix from
crashing when the directory exist but cannot be listed.
This generally happens when the caller doesn't have
enough permission to list.

Test: atest CtsNetTestCases:android.net.cts.NetworkStatsManagerTest#testDataMigrationUtils
Ignore-AOSP-First: in a topic with internal-only changes
Bug: 230289468
Change-Id: I4177a8229cc9db18d76cb90c54a1b8d12ef8d98f
1 file changed