Issue 22: Use a lockfile to prevent multiple clients syncing simultaneously.

Fixes #22.