MB-11560 Avoid tmpfile() completely. Generate own

As writing to /tmp is not supported, this change replaces
the calls to tmpfile() with a implementation that generates
unique filenames within the context of a compact call and
immediately unlinks them to ensure deletion from OS
Change-Id: Id22c6affed6d495cbe2c1aa7b7cbcfb3c6ea1e8d
Reviewed-on: http://review.couchbase.org/39042
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
Reviewed-by: Sundararaman Sridharan <sundar@couchbase.com>
Tested-by: Sundararaman Sridharan <sundar@couchbase.com>