Get link state with same lock as LinkProperties

The previous IpClientLinkObserver code could in theory call
mCallback.update with a linkState that came from another update; for
example:
 1. onInterfaceAddressUpdated
   - mLinkProperties.addLinkAddress
 2. onInterfaceLinkStateChanged
   - setInterfaceLinkState(false)
 1. mCallback.update(false) <- should be true ?
 2. mCallback.update(false)

In practice this would not happen because the onFoo methods are all
called in order (same binder token from netd), but IpClientLinkObserver
should not need to make such assumptions.

Bug: 151796056
Test: atest NetworkStackIntegrationTests (see also test-only change)
(clean cherry-pick from internal branch)
Merged-In: I60f5a319519069070eb5a07643686bf5ec937665

Change-Id: I60f5a319519069070eb5a07643686bf5ec937665
1 file changed