Fix SEGV in write_covars: deal with missing phenotypes

* When phenotypes contain a missing value, `--write-covar --with-phenotype` causes SEGV.
* Modified as a `write_fam` function does.