c# wait for thread to finish without blocking