freeze winform app until loop exits - C#