wifi: fix first connection security params selection

In getCandiatesFromScanResults, it will clear network candidates of all
networks, i.e. updating candidate security params does not work
actually.

As getCandiatesFromScanResults is too heavy for just a quick selection,
extracting the security params selection part and adding the same
security params filtering algorithm to have consistent behaviors with
selectNetwork().

Bug: 202109093
Bug: 200241403
Test: atest FrameworksWifiTests
Change-Id: Id291d4f48aed1a69a30de06b510cb416938e031e
(cherry picked from commit 1a2c5068eec2f145487190d15fc8688efa31502a)
3 files changed