implement PID based locking. closes #60

This avoids stale lock files completely. Even if the app crashes, the
remaining lockfile will be a symlink to a no longer existing process.