Avoid chmod() calls on directories

There are several reasons for that:
- the reason that triggered this patch is that the pledge() sandboxing
system on OpenBSD forbids chmod() by default in many pledged
applications. When one of these needs to rebuild the font cache it
will fail because of these unneeded chmod() calls.
- trying to change existing directories access rights isn't a good idea
- and lastly doing mkdir() && chmod() is racy. Use umask() to make shure
the directory is created with the proper access rights from start.

Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
3 jobs for no-chmod in 4 minutes and 48 seconds (queued for 1 second)
latest
Status Job ID Name Coverage
  Build
passed #828301
mingw-build

00:04:05

passed #828299
shared-build

00:04:48

passed #828300
static-build

00:02:54