Use write_buffer_to_statsd within StatsLog_write

This CL is a partial cherrypick of ag/9686088. This is needed because new
changes to libstatssocket (that need to be cherrypicked into AOSP) wrap
#write_to_statsd() with #write_buffer_to_statsd().

Bug: 143978873
Test: m -j
Test: flashes successfully
Test: DocumentsUI(a Mainline module) is able to successfully log to statsd
Change-Id: I886331f728ccaa3d281b5683eb89179aa73596b6
Merged-In: I9cdc6151d8feb29a712532e50f143af9d52c8d94
2 files changed