Properly release last spawned process if program scheduler is shutdown