Add shutdown hook to clean up child processes