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.

--HG--
extra : amend_source : 1967fc7d6960b3fcc29b9fbeb50f01d6b68a0fd0