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 : 9e3d038ce8c7b4ac5feb476d9ce39a50832ee673