Fix TPED output.

TPED output had the following issues:
1) the identifier was not unique for a small subset of the variants,
so variant_id is appended to the identifier to make it unique
2) TPED needs both alleles set even if the chromosome is haploid, so
we treat haploid or single-allele called males as homozygous on
the sex chromosomes. heterozygous males are set as missing, unless
the variant is in the PAR region then it is set to being heterozygous.
females have all variants called on the Y chromosome set to missing.