Issue 774, 782: chmod() after creating a file or dir
If the user's system has a default umask, then
mkdir(pathname, mode);
will report "success" even if the created dir does not match the specified
mode. Presumably that is desired in the general case, but when it comes to
testing libarchive this can generate false errors in `make check`.
chmod() is not affected by umask, so we call that after creating the file
or directory.