check: Use mkstemp instead of tempnam if possible