python: Fixed memory leaks during dispatch.