On my Linux Mint 19.1:
```bash
$ umask
0022
```

After the first run of `bitcoin-qt -sysperm=false` the `0700` permissions are expected for both the datadir (`~/.bitcoin`) and the walletdir (`~/.bitcoin/wallets`).

Actually, the directories are created with such access permissions:
```bash
$ stat ~/.bitcoin | grep Uid
Access: (0755/drwxr-xr-x)  Uid: ( 1000/ hebasto)   Gid: ( 1000/ hebasto)
$ stat ~/.bitcoin/wallets | grep Uid
Access: (0755/drwxr-xr-x)  Uid: ( 1000/ hebasto)   Gid: ( 1000/ hebasto)
```

Refs:
- #4286
- #13371
- #13389

NOTE: reading through the initial PR #4286 makes me think it was controversial. Is it a better and simpler way to just get rid of `-sysperm` option? I believe a user who needs this option can easily run `chown` command.
{
    if (fflush(file) != 0) { 
        LogPrintf("%s: fflush failed: %d\n", __func__, errno);
        return false;
    }
#ifdef WIN32
    HANDLE hFile = (HANDLE)_get_osfhandle(_fileno(file));
    if (FlushFileBuffers(hFile) == 0) {
        LogPrintf("%s: FlushFileBuffers failed: %d\n", __func__, GetLastError());
        return false;
    }
#elif defined(MAC_OSX) && defined(F_FULLFSYNC)
    if (fcntl(fileno(file), F_FULLFSYNC, 0) == -1) { 
        LogPrintf("%s: fcntl F_FULLFSYNC failed: %d\n", __func__, errno);
        return false;
    }
#elif HAVE_FDATASYNC
    if (fdatasync(fileno(file)) != 0 && errno != EINVAL) { 
        LogPrintf("%s: fdatasync failed: %d\n", __func__, errno);
        return false;
    }
#else
    if (fsync(fileno(file)) != 0 && errno != EINVAL) {
        LogPrintf("%s: fsync failed: %d\n", __func__, errno);
        return false;
    }
#endif
    return true;
}
void DirectoryCommit(const fs::path &dirname)