[B5R3] Check NetworkHandle against OutOfBound access

In corner case, the lastValidIndex could be the out of
range of mAllNetworkHandles.

Bug: 158528640
Test: Build pass and basic function verify pass
Change-Id: Id15add603307f1bae82dcf2c0013fe0305ba1a0c
CRs-fixed: 2690874
diff --git a/core/SystemStatus.h b/core/SystemStatus.h
index fe6c6c6..8d5d9ac 100644
--- a/core/SystemStatus.h
+++ b/core/SystemStatus.h
@@ -551,6 +551,9 @@
                     typeCount--;
                 }
             }
+            if (MAX_NETWORK_HANDLES == lastValidIndex) {
+                --lastValidIndex;
+            }
 
             if (MAX_NETWORK_HANDLES != deletedIndex) {
                 LOC_LOGD("deletedIndex:%u, lastValidIndex:%u, typeCount:%u",