Cleanup child processes when exiting. Fixes #274