Fix memory leaks in the wcs bindings

I came across these while investigating something unrelated.