Add some code useful for debugging memory leaks and such

You just do a killall -3 python and BOOM, you got some pdb.