Clean up the keepalive slots when network disconnect

In general, keepalive slots are released after result of
stopping has returned. However, for network disconnect case,
the service side cannot communicate with network agent since
the async channel is broken.

Clean up keepalive slots right after stop in this case.

Bug: 132341736
Test: 1. atest com.android.server.ConnectivityServiceTest \
         #testNattSocketKeepalives --generate-new-metrics 100
      2. atest FrameworksNetTests --generate-new-metrics 10

Change-Id: Ia30741f71fa72fc117e071976fd73991fa3c9535
1 file changed