Thiolation of starch and other polysaccharides