Use mkstemp to be secure.

Also, remove obsolete switching off warnings (python 2.2 is really not
supported anymore).

Signed-off-by: Matěj Cepl <mcepl@redhat.com>