Unfortunately there really isn't anything you can do to stop the silkworms from spinning coccoons. Once they get to a certain age and size, they will coccoon. However, like orlanda mentioned, you can easily breed your own silkworms. Their eggs can be stores in the fridge for up to a year and hatch about 10 after taken out of the fridge at room temperatures (70-75F is best). Silkworm chow or mulberry leaves are the only foods you can feed silkworms.
Not feeding silkworms won't stop them from coccooning but most likely they wont' survive to morph into moths. Providing a little less food will slow them down somewhat but eventually they will still coccoon.
The only way you can use up all the silkworms before they go into coccoons, is to buy them at a smaller size and feed more to your dragon (i find getting mediums is best, by the time they are nearly used up, they are just hitting their max size).
-----
PHLdyPayne