A man has been sentenced to five years jail after a woman he accused of using witchcraft was raped and murdered by a mob.