Fix logic to preserve preferred APN across build update.

It includes 2 changes:
1. Save preferred apn before upgrading db.
2. List of unique fields may have changed; handle that.

Test: manual and TelephonyDatabaseHelperTest
Bug: 139649129
Change-Id: I1aefcb2255ff9d78d875eaacfdace53b4358103d
2 files changed