Fix a race condition in the master election.

It was only when stopping the election, so not too major, but still, let's
fix it!
Add test for util::SyncTask.
Merge branch 'util_sync_task' into integration
Convert etcd watchers to use util::Task.
Hack hack hack!