Fix push notification with project based matrix authorization strategy

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.