Cleans up started processes when exiting on error
Fixes a warning in debug mode