Working on "Use std::filesystem. Remove Boost Filesystem & System" #20744, I found an unfortunate [pitfall](https://github.com/bitcoin/bitcoin/pull/20744#issuecomment-946046666) -- `boost/process.hpp` depends on `boost::filesystem` when cross-compiling for Windows. It happens in Guix environment as well.

The goal of this issue is to discuss and find a solution to get rid of `boost::filesystem`.
ArgsManager gArgs;
static Mutex cs_dir_locks;
/** A map that contains all the currently held directory locks. After
 * successful locking, these will be held here until the global destructor
 * cleans them up and thus automatically unlocks them, or ReleaseDirectoryLocks
 * is called.
 */
static std::map<std::string, std::unique_ptr<fsbridge::FileLock>> dir_locks GUARDED_BY(cs_dir_locks);
bool LockDirectory(const fs::path& directory, const std::string lockfile_name, bool probe_only)
{
    LOCK(cs_dir_locks);
    fs::path pathLockFile = directory / lockfile_name;
    
    if (dir_locks.count(fs::PathToString(pathLockFile))) {
        return true;
    }
    
    FILE* file = fsbridge::fopen(pathLockFile, "a");
    if (file) fclose(file);
    auto lock = std::make_unique<fsbridge::FileLock>(pathLockFile);
    if (!lock->TryLock()) {
        return error("Error while attempting to lock directory %s: %s", fs::PathToString(directory), lock->GetReason());
    }
    if (!probe_only) {
        
        dir_locks.emplace(fs::PathToString(pathLockFile), std::move(lock));
    }
    return true;
}
void UnlockDirectory(const fs::path& directory, const std::string& lockfile_name)