Work on bad accesses and then memory leaks.

The new function allows us to free global Python resources at exit.