dup: set secure permissions on tmpdir when creating it