[JENKINS-18804] Fix NPE in TriggeredBuildSelector

[JENKINS-18804] (https://issues.jenkins-ci.org/browse/JENKINS-18804)
I think I can track upstream builds even when the direct upstream is removed, using `UpstreamCause#getUpstreamCauses`.
The purpose of this pull request is just to avoid NPE and that improvement should be done as another issue.