[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
1 file changed