[JENKINS-17807] Fix NPE on building with certain other plugins installed

Fixes https://issues.jenkins-ci.org/browse/JENKINS-17807 by gating around the affected code. The build now runs fine with EnvInject, Perforce SCM and any other plugin that calls getProjectActions() at this point in the build lifecycle. Tested on Jenkins 1.555