I believe freezing should kill the larvae and the eggs, as all cells should split once frozen. The only way to avoid this would be flash freezing with liquid nitrogen. I bought some potting soil and let it on the porch for the winter; when I recently brought it in for cuttings I noticed that there were no fungus gnats :).