pass template string as argument of mktemp for compatibility with BSD