Fix to make POP and Imap more locale safe

Cherry-picks from:
https://android-review.googlesource.com/#/c/42334/
https://android-review.googlesource.com/#/c/42332/

Bug: 7138507

Change-Id: I557c3d8c725cf6dc4f13f227dcec63864ab5db67
2 files changed