A leader of Somalia's al-Shabab with a $3m bounty on his head has announced he is leaving the armed group.