added pthread_kill() for children on exiting