Fix mktmp to be generic as-per SUS/BSD