[PM] Fix the restoring sdk library version issues

ArrayUtils#append* doesn't allow the duplicated case by default.
The behavior is like `Set`. Add more checks for restoring the sdk lib
information.

Flag: EXEMPT bugfix
Bug: 355318028
Test: atest ArrayUtilsTest
Test: atest PackageManagerSettingsTests
Change-Id: If903a7443aadb0ef0306df86bb4442666220923f
5 files changed