[c#] How to check if Thread finished execution