MB-12138 Add function for generating temporary filename
MB-12138 Add function for generating temporary filename

mkstemp was not generating a unique file name on windows and
it was causing problem in sorting the data while using temporary files.
Due to which index building was failing. Added a new function to
generate temporary files.

Change-Id: If87d84dacbfe931e6ef1f0217405c0d6b63359d9
Reviewed-on: http://review.couchbase.org/41480
Reviewed-by: Sarath Lakshman <d41e430501c5d3aeeb2b91142f917f514040f807@couchbase.com>
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>

jimwwalker/couchstore,couchbaselabs/couchstore,jimwwalker/couchstore,abhinavdangeti/couchstore,couchbaselabs/couchstore,abhinavdangeti/couchstore,vmx/couchstore,couchbaselabs/couchstore,jimwwalker/couchstore,abhinavdangeti/couchstore,vmx/couchstore,vmx/couchstore