Fix push notification when anonymous users lack read access

Push notification (notifyCommit) does not work with enabled project based matrix authorization strategy. This is the same problem as [JENKINS-12022](https://issues.jenkins-ci.org/browse/JENKINS-12022) for git-plugin. The changes are mainly taken from the git-plugin.