How do I close a panel without leaving hanging processes?

When I serve a panel app programmatically, i.e., with panel.serve(), If I stop it with a ctrl-c, it leaves zombie processes behind. How can I avoid that?