Fixed group share searching, continued.

Avoid searching for empty group list in getItemSharedWithUser().
Broke tests in previous commit, #12030.