While testing 17270 I noticed that master (bdda137878904e9401a84e308ac74c93c2ef87c1) does not run on NetBSD. I assume this started after #17085 changed the fallback locale from `C` to `C.UTF-8`. There doesn't seem to be a `C.UTF-8` locale on NetBSD.

```bash
src/bitcoind
terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid
Abort trap (core dumped)
```

`LC_ALL=C src/bitcoind` works, `LC_ALL=en_US.UTF-8 src/bitcoind` does not.

```bash
locale
LANG=""
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=""
```
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(pathLockFile.string())) {
        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", directory.string(), lock->GetReason());
    }
    if (!probe_only) {
        
        dir_locks.emplace(pathLockFile.string(), std::move(lock));
    }
    return true;
}
void UnlockDirectory(const fs::path& directory, const std::string& lockfile_name)