fixed multiple memory leaks, OMP code

C# images are the leakiest things since the Danaids' vessels. I don't
think I can get any better than leaking ~.5 GB per run. It's so bad.