Implement uv_fs_mkdtemp

I implemented `uv_fs_mkdtemp` for unices and created a test for that. Could someone confirm that I am on the right way or provide some suggestions before I start implementing `uv_fs_mkdtemp` for Windows? Specifically I'm in doubt whether `uv_fs_t->ptr` is the right place for storing the name of temp directory which was created by underlying `mkdtemp`.

For Windows I want to use `glibc`'s [implementation](http://fossies.org/dox/glibc-2.19/mkdtemp_8c_source.html) which uses [`__gen_tempname`](http://fossies.org/dox/glibc-2.19/sysdeps_2posix_2tempname_8c_source.html#l00229).

Should close #1315
Of course the user has to call that function, that's how it works. Not sure
what your concern is.
On Jul 19, 2014 9:58 AM, "Andrius Bentkus" <notifications@github.com> wrote:

> In src/unix/fs.c:
>
> > @@ -991,6 +997,18 @@ int uv_fs_mkdir(uv_loop_t* loop,
> >  }
> >
> >
> > +int uv_fs_mkdtemp(uv_loop_t* loop,
> > +                  uv_fs_t* req,
> > +                  const char* template,
> > +                  uv_fs_cb cb) {
> > +  INIT(MKDTEMP);
> > +  req->path = strdup(template);
>
> https://github.com/Hinidu/libuv/blob/mkdtemp/src/unix/fs.c#L1173
>
> everywhere we use free(var), but here we are using free((void *) var);
>
> The user has to actually clean up after the operation is finished by
> calling uv_fs_req_cleanup.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/joyent/libuv/pull/1368/files#r15142632>.
>