[JENKINS-48348] If task can be run only on master, use shortcut
[JENKINS-48348] If task can be run only on master, use shortcut

Currently Jenkins to fire WorkflowJob re-calculates the ConstistentHash
for entire cluster even if there is no nodes were updated. If cluster is
big enough (>100 nodes), it becomes a problem, because MD5 is quite
expensive itself plus all this logic comes with high memory footprint.

Using the knowledge that WorkflowJob can be executed only on Jenkins master,
we can create a shortcut that does not do expensive calculation and just
returns Runnable or `null`.

(cherry picked from commit 00ccd23f6441a55bfd625660911d4bc79c7578ba)

pjanouse/jenkins,damianszczepanik/jenkins,sathiya-mit/jenkins,jenkinsci/jenkins,ikedam/jenkins,stephenc/jenkins,rsandell/jenkins,stephenc/jenkins,oleg-nenashev/jenkins,rsandell/jenkins,rsandell/jenkins,Vlatombe/jenkins,pjanouse/jenkins,pjanouse/jenkins,dariver/jenkins,DanielWeber/jenkins,jenkinsci/jenkins,daniel-beck/jenkins,ikedam/jenkins,godfath3r/jenkins,andresrc/jenkins,amuniz/jenkins,oleg-nenashev/jenkins,pjanouse/jenkins,ErikVerheul/jenkins,batmat/jenkins,DanielWeber/jenkins,oleg-nenashev/jenkins,ErikVerheul/jenkins,sathiya-mit/jenkins,bkmeneguello/jenkins,daniel-beck/jenkins,amuniz/jenkins,stephenc/jenkins,jenkinsci/jenkins,andresrc/jenkins,aldaris/jenkins,aldaris/jenkins,kohsuke/hudson,daniel-beck/jenkins,MarkEWaite/jenkins,patbos/jenkins,jenkinsci/jenkins,batmat/jenkins,kohsuke/hudson,MarkEWaite/jenkins,aldaris/jenkins,kohsuke/hudson,rsandell/jenkins,patbos/jenkins,MarkEWaite/jenkins,daniel-beck/jenkins,v1v/jenkins,Jochen-A-Fuerbacher/jenkins,dariver/jenkins,batmat/jenkins,ErikVerheul/jenkins,ikedam/jenkins,andresrc/jenkins,recena/jenkins,Jochen-A-Fuerbacher/jenkins,rsandell/jenkins,DanielWeber/jenkins,jenkinsci/jenkins,damianszczepanik/jenkins,aldaris/jenkins,viqueen/jenkins,sathiya-mit/jenkins,godfath3r/jenkins,ikedam/jenkins,Vlatombe/jenkins,pjanouse/jenkins,rsandell/jenkins,rsandell/jenkins,damianszczepanik/jenkins,Jochen-A-Fuerbacher/jenkins,recena/jenkins,batmat/jenkins,jenkinsci/jenkins,viqueen/jenkins,andresrc/jenkins,damianszczepanik/jenkins,MarkEWaite/jenkins,oleg-nenashev/jenkins,bkmeneguello/jenkins,dariver/jenkins,bkmeneguello/jenkins,v1v/jenkins,stephenc/jenkins,patbos/jenkins,patbos/jenkins,amuniz/jenkins,ErikVerheul/jenkins,godfath3r/jenkins,rsandell/jenkins,stephenc/jenkins,MarkEWaite/jenkins,kohsuke/hudson,patbos/jenkins,recena/jenkins,dariver/jenkins,recena/jenkins,viqueen/jenkins,Vlatombe/jenkins,kohsuke/hudson,v1v/jenkins,ErikVerheul/jenkins,viqueen/jenkins,viqueen/jenkins,godfath3r/jenkins,daniel-beck/jenkins,ikedam/jenkins,Jochen-A-Fuerbacher/jenkins,godfath3r/jenkins,viqueen/jenkins,kohsuke/hudson,Jochen-A-Fuerbacher/jenkins,bkmeneguello/jenkins,Vlatombe/jenkins,DanielWeber/jenkins,Jochen-A-Fuerbacher/jenkins,v1v/jenkins,batmat/jenkins,bkmeneguello/jenkins,sathiya-mit/jenkins,jenkinsci/jenkins,Vlatombe/jenkins,amuniz/jenkins,stephenc/jenkins,andresrc/jenkins,Vlatombe/jenkins,ErikVerheul/jenkins,amuniz/jenkins,batmat/jenkins,Vlatombe/jenkins,andresrc/jenkins,ErikVerheul/jenkins,damianszczepanik/jenkins,sathiya-mit/jenkins,bkmeneguello/jenkins,amuniz/jenkins,andresrc/jenkins,pjanouse/jenkins,DanielWeber/jenkins,ikedam/jenkins,bkmeneguello/jenkins,godfath3r/jenkins,ikedam/jenkins,viqueen/jenkins,ikedam/jenkins,daniel-beck/jenkins,oleg-nenashev/jenkins,jenkinsci/jenkins,kohsuke/hudson,kohsuke/hudson,MarkEWaite/jenkins,MarkEWaite/jenkins,Jochen-A-Fuerbacher/jenkins,DanielWeber/jenkins,damianszczepanik/jenkins,aldaris/jenkins,v1v/jenkins,v1v/jenkins,dariver/jenkins,MarkEWaite/jenkins,damianszczepanik/jenkins,patbos/jenkins,sathiya-mit/jenkins,aldaris/jenkins,oleg-nenashev/jenkins,batmat/jenkins,sathiya-mit/jenkins,pjanouse/jenkins,patbos/jenkins,godfath3r/jenkins,aldaris/jenkins,v1v/jenkins,damianszczepanik/jenkins,DanielWeber/jenkins,recena/jenkins,amuniz/jenkins,stephenc/jenkins,recena/jenkins,daniel-beck/jenkins,oleg-nenashev/jenkins,dariver/jenkins,recena/jenkins,dariver/jenkins,daniel-beck/jenkins