Fix the integer overflow/underflow caused by sorting of duplicate phoneaccounts during emergency call attempt. am: 7b0e82975a

Original change: https://android-review.googlesource.com/c/platform/packages/services/Telecomm/+/1903050

Change-Id: Ia3aea3e7bd6a7eb3bae7fa4cbfc81e22fa4db820