Fix race in StaEvents metrics collection

A race is happening because one part of StaEventList modification is
current unprotected, and we have 2 different threads that trigger
StaEventList modifications:
- Thread 1: Binder thread -> dump() -> clearing StaEventList
- Thread 2: WifiLooper -> addStaEvent() -> may result in removing first
element if StaEventList if 'full'

Bug: 145673220
Test: atest FrameworksWifiTests

Change-Id: Id390bae9a9a661900073195fd1224106a03273ee
Merged-In: Id390bae9a9a661900073195fd1224106a03273ee
(cherry picked from commit df3b786149d9a86fdc247ec9cc7910e6b98de1cf)
1 file changed