Chemical trends of defect formation in Si quantum dots: The case of group-III and group-V dopants