ClientModeImpl: Ignore NETWORK_CONNECTION_EVENT while disconnecting

If we've triggered a disconnect, ignore any NETWORK_CONNECTION_EVENTs
(triggered if the fw roams just before that). Since we will anyway get a
NETWORK_DISCONNECTION_EVENT just after that, reacting to the transient
event is not useful.

Also, ensure that we explicitly unregister any previous network agent
active when creating new one. This is just a failsafe since the fix
above should anyway take care of the scenario in this particular bug.

Bug: 151067137
Test: atest com.android.server.wifi
Test: ACTS presubmit tests
Change-Id: I9657c4775922888623794dd749a42378d553ebee
Merged-In: I9657c4775922888623794dd749a42378d553ebee
2 files changed