Free sktmp when it's no longer needed. By doing so, we fix a bunch of memory leaks.

From miod@

OK from miod@ and guenther@