fn lock_directory( sess: &Session, session_dir: &Path) -> Result<(Lock, PathBuf), ErrorGuaranteed>
Allocate the lock-file and lock it.