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 : 264a21f02dafe17a4bcd283b034c653f374ba8e2