mktemp: use more portable version.

Removes the deprecated -t flag, which doesn't work on Travis.

Also replaces backtick usages with $()