Fixed Memory issues (v 1.0.2 for windows)

The nearest neighbor polar/inverse transforms were using different
allocation methods than the other functions, and I hadn't realized
that when I was freeing memory, so there were several memory leaks.
This code should be memory leak free