fix memory leaks detected by coverity.
Merge pull request #211 from ged-lab/python-c-cleanup

fix memory leaks detected by coverity.