Add synchronization to prevent post-melt collects
This fixes a race condition in which snowflakes.End() is called while snowflakes.Collect() is in progress resulting in a write to a closed channel. We now wait for all in-progress collections to finish and add an extra check before proceeding with a collection.
Closes #40017 (closed)