How to find out if a process fails? - C#