Afghan spy chief resigns over disagreements with Ghani