More correct startup and shutdown procedures.

During IpManager startup, anything sending messages to the state machine
must not begin doing so until after the state machine has been started.
Reorder the constructor accordingly.

During shutdown, AvoidBadWifiTracker needs to unregister the registered
BroadcastReceiver and might as well also unregister the ContentObserver.

Test: backport from internal
Bug: 33388922
Change-Id: I58e07f7ccddaab160c153bcfb69fd45f50bb8710
3 files changed