Update SpecialContributionsBeforeMainOutput hook handler

Can't use user id for anonymous users

Bug: 66624
Change-Id: I49848fcc166be1057b45d476f0c7aad9827704f5
Merge "Update SpecialContributionsBeforeMainOutput hook handler"