Fix some rather large memory leaks in the wcs bindings.
Merge pull request #2440 from mdboom/wcs/memory-leaks

Fix memory leaks in the wcs bindings