Genes that may have helped ancestors survive the Black Death make us more vulnerable to certain diseases today, a study says.