fixing several memory leaks in pygit2

* added missing deconstructors
* us Py_CLEAR through the whole lib
* refactorization