Updates to `bp_activity_user_can_delete()`:

* Wrap `$can_delete` checks is `is_user_logged_in()` to avoid superfluous processing on activity items when no user is logged in.
* Cast return value to boolean.
* Add some inline documentation.
* Add an `empty()` check on `$activities_template->activity` to avoid using it if the global is not setup yet.
* Add some brackets.


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