Fix worker pool terminate bug