Correct typo
Only bother attempting a sync if enabled

If the agent isn't enabled updating the metadata is a bit moot.
Cache metadata locally to allow conditional sync

In isolation, updating the device metadata requires two API calls; one
to locate the device, and one to perform the update. Currently the API
libs take care of skipping the second call if nothing has changed,
however by caching locally we can also avoid the device lookup call.
Merge pull request #6 from mal/sync-improvements

Sync improvements