use mkstemp

Use mkstemp in apt-extracttemplates