fix network disconnection handling

We should avoid network id set unless the access point is associating.
Also, we should reset network connection state before sending
out network change broadcast.

Finally, we should reset connect mode settings when we disconnect from
an access point

Bug: 3424635
Change-Id: I41db5399810218abd6a77155166db5a9b1dbd22c
2 files changed