Mushtaq Ahmed has left his role as England spin-bowling coach to take up a similar position with Pakistan.