Update to dirstate locking. Move all of WT4.lock_* functions locally, so that they can properly interact and cleanup around when we lock/unlock the dirstate file. Change all Lock objects to be non-blocking. So that if someone grabs a lock on the DirState we find out immediately, rather than blocking. Change WT4.unlock() so that if the dirstate is dirty, it will save the contents even if it only has a read lock. It does this by trying to take a write lock, if it fails we just ignore it. If it succeeds, then we can flush to disk. This is more important now that DirState tracks file changes. It allows 'bzr status' to update the cached stat and sha values.