fixed facts gathering for strict remote umasks

Instead of calling `chmod` to change the mode for the directory *after* its creation, the umask is temporarily altered *before* calling `mkdir` to ensure the parent directories that are possibly created have the desired mode too.