Current cygwin fails to delete or create /dev, since it's always
available as a virtual directory. rm fails because it's not empty
and mkdir fails because it already exists.
We could shell out to cmd.exe, but let's just continue to assume that
/dev exists in the installer base.
Also saves a useless mkdir call.
When launching a custom msys2 environment, and it does "first-run"
operations, it complains that: "cannot change permissions of
'/dev/shm': Permission denied".
This is related to the previous work in this area that happened
in #2337: Since "/" is mounted with noacl and chmod() is a no-op,
this error is cosmetic and can be removed.
However, in #2337, the access modifying behaviour was not removed
from the "mkdir" branch, which this patch aims to address.
Although the default and most used way to install MSYS2 is to have it
user-writable, some users prefer to have the root writable only to
admins. In that case, the 01-devices.post script would always print out
two failures on "login" when trying to chmod /dev/{shm,mqueue}. Since
the only supported configuration for MSYS2 is to mount `/` with noacl
where chmod() is a no-op, the failure is purely cosmetic, as is the
chmod invocation itself. For these reasons, let's not chmod at all.
I'm aware the non-user-writable root configuration itself is not
officially supported either, but I've been using it like that for years
now and this is the only issue I know of, so I think it's reasonable to
resolve this.