ENG-5096: Fix broken StreamSnapshotDataTarget.close() ordering.

The end-of-stream message should be sent out after all outstanding work has been
cleared, so that if there is an error, the EOS message will include the correct
failure flag.