Malloc memory if mkdir does not have enough on the stack.