fn lock_directory( sess: &Session, session_dir: &Path, new_session: bool, ) -> Option<LockedDir>
Allocate the lock-file, lock it and create the session directory if requested.