Use lockfile for interprocess locking.

Resolves #31.