Clean up sync manager and fix the lock screen blocked sync issue.

- Fix the issue where when a sync starts when the user is locked, the sync
is enqueued and waits for the 10 minute timeout, which drains the battery.

Now, in this case, we finished the job right away, and if it's a non-periodic
sync, we ask the job scheduler to reschedule.

- Clean up all the mess and unnecessary code.

Fixes: 79433653
Test: manual: Add an account, remove it, make sure all the sync operations are
gone from dumpsys content.
Test: manual: Use the requestsync command while the user is locked and
make sure the sync won't stuck.

Change-Id: I8cfd6a80715336ebea3793b2ed10b59d90cd8e52
4 files changed