cli: Use mkstemp instead of mktemp.