Checking whether sync is required before syncing.

The plugin was sending a 'sync start' and then checking whether a
sync is required. Instead, the plugin should send a 'sync start'
only after it has determined that a sync in indeed required.