Create more robust parent-process walking code.

This fixes a NullReferenceException that occurs when the current process has no (accessible) parent process.

Also, it's shorter, and the implementation is reused in the Tfs and VisualStudio reporters.

The NRE is currently problematic for me as it's making using nunit's GUI on my machine impossible (loading test cases aborts with an exception in the VisualStudioReporter).
If we catch `InvalidOperationException` here it guards against corrupted performance counters.

In fact, I think we should just catch all here.