Whole-genome sequencing reveals a complex African population demographic history and signatures of local adaptation