create temp dir in /tmp, delete temp dir, use stack buffers for strings
create temp dir in /tmp, delete temp dir, use stack buffers for strings

(1) Now creates the temporary directory in /tmp on Linux, instead of in
    the current working directory.

(2) Will now delete the temporary directory as well before the function
    returns (was only deleting the temporary file before).

(3) Now uses a buffer on the stack instead of malloc() when constructing
    the paths, to avoid memory leaks due to Mat_Critical() never returning
    to caller, and to optimize for better performance.

MaartenBent/matio,MaartenBent/matio,tbeu/matio,MaartenBent/matio,tbeu/matio,tbeu/matio,MaartenBent/matio,tbeu/matio