Added code to release memory if an exception is thrown and the C++ wrapper function is exited (both 2D and 3D functions).

git-svn-id: svn://svn.r-forge.r-project.org/svnroot/ptinpoly@29 edb9625f-4e0d-4859-8d74-9fd3b1da38cb