Fix timing race condition in toggling ProtoLog to logcat

It was possible for the viewer config to be unloaded before we updated the log to proto state variable to false leading to crashes.

Change-Id: I26b2ec045df22cfbd417452794435894a9cc092b
Flag: EXEMPT small bug fix
Test: atest com.android.internal.protolog.ProcessedPerfettoProtoLogImplTest
3 files changed