Within-host competition and drug resistance in the human malaria parasite Plasmodium falciparum