Fix FGS enter/exit statslog semantics

Logging wasn't quite right in the case of deferred FGS notification in
various ordering scenarios.

Bug: 189926836
Test: atest CtsStatsdAtomHostTestCases:android.cts.statsdatom.statsd.UidAtomTests#testForegroundServiceState
Change-Id: I650730db9e01faa90a36a73b486464ab5b179fc6
4 files changed