[Statsd socket] Batch reads

Batch reads from the socket. The goal is to read all the data that is
available when any data is available. Ideally this helps with scheduling
pressure, especially during boot.

Bug: 333809942
Test: adb shell cmd stats print-stats
Test: atest statsd_test
Test: locally verified atoms were still getting logged
Ignore-AOSP-First: Internal for testing, will submit to AOSP after
review
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a740f94254cecaa0c8657f9b11eb17c95565a063)
Merged-In: I5fb9367450e51d9948251853fe5780da7ebb9315
Change-Id: I5fb9367450e51d9948251853fe5780da7ebb9315
5 files changed