path: use mkstemp when available

This change reworks

	char *cainteoir::get_temp_filename()

to

	FILE *cainteoir::create_temp_file(const char *mode)

This is to address the security warning/function deprecation when
using 'tempnam'. This is because 'mkstemp' returns a file
descriptor, not the filename.