mkostemp: fix implementation