Better checks for existence of parent item when recursing to calculate activity comment depth

The changes introduced in r8201 involve calculating tree depth for each queried
activity comment in a loop. The technique used involves traversing up a tree by
fetching the parent item until the root level is reached. However, the original
technique did not account for the fact that in certain cases - namely, when
display_comments=threaded - it may not be the case that all of the comment
ancestors are available in the current query. This failed logic resulted in
infinite regression in these sorts of cases.

The correction involves performing a separate query for the direct activity
parent when it is not found in the queried items.

Props r-a-y

Fixes #2768

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8226 cdf35c40-ae34-48e0-9cc9-0c9da1808c22