Fix Perfetto.cpp to silence SELinux warnings

Turns out that statsd leaves some file descriptors opened
without the O_CLOEXEC flag. This CL mass-closes file descriptors
up to a realistic number of FDs. This is to avoid SELinux complaining
about perfetto accessing these files from the statsd domain.

With this change perfetto works with statsd without disabling SELinux.
Relevant SELinux CL:
https://android-review.googlesource.com/c/platform/system/sepolicy/+/598774

Change-Id: I745d621937fbc9b20a4c733948cd0dd24dd6e8b2
1 file changed