Allow callers to synchronously block for shutdown

Add a simple CountDownLatch and a public method that callers can use
to block until IpClient has cleanly shutdown the state machine.

In cases where IpClients are created and destroyed dynamically for
the same interface name, this can be used to make sure only one
IpClient at a time is touching the given interface.

Test: as follows
    - built
    - flashed
    - booted
    - OTG ethernet works (i.e. client mode)
    - removing and reinserting the ethernet dongle continues
      to show the <-> Ethernet sysui icon and basic network
      connectivity works
    - removing and reinserting the cable (link up/down events)
      also shows the <-> Ethernet sysui icon and basic network
      connectivity works
Bug: 62476366

Change-Id: If4bffd54b7ebc088ec07cac10251e451f8161b6c
1 file changed