Intelligent Locking

cw.o picked up some new functins for handling advisory filesystem locks
more flexibly.  Namely:

- Each lock file encodes information about the lock holder
- When acquiring a lock, the owner of the lock file is verified
- If the owning PID isn't found, or isn't owned by the correct EUID,
  the lock file is unlinked and the lock acquisition re-attempted.
- It is possible to interrogate a failed lock for its current holder,
  to make it easier to track down errant processes.