ENG-4870: Only terminate sender and ack tracking threads when all stream snapshot data targets are finished

Some data targets may close earlier than the others. For those that close early,
they shouldn't terminate the global sender thread and the global ack tracking
thread. The thread should only be terminated after all data targets have
finished doing their works.