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 : 6ba5dcbd4e0276d9c83f8a47c54e4f0aa9c5ac60