Use wifi client connected state with WifiLocks

Current implementation does not take into consideration the wifi client
connection state when enabling high-perf and low-latency locks. This may
result in unneeded impact to device scanning and causes inaccurate blaming
metrics for apps acquiring the lock while device is not connected.
This commit only enables the WifiLocks to take effect when device is
connected to an AP.

Bug: 127884567
Test: Manual
Test: Connecting/disconnecting wifi from AP while acquiring/relaseing WifiLocks
Test: atest com.android.server.wifi
Change-Id: If7a17f4760c10819a679861c7393e7850ab32236
4 files changed