Fix validation use of FolderSync

* To avoid having to use a mock deviceId with FolderSync in validation, we now
  simply use the real deviceId with the correct SyncKey ("0" for a new account,
  or the actual sync key if the account already exists)
* Rework utility code that finds existing accounts
* Write unit test for findExistingAccount

Bug: 2589243
Change-Id: Ia532b2e209aec3aa01ca06617b4da78c3d986b32
1 file changed