Fix validation of downstream projects for Maven projects.

Hi,

There was a problem validating the upstream project name when you added a manual trigger to a Maven project. This was caused by the fact that a maven project is both an AbstractProject and an ItemGroup. So doCheckDownstreamProjectNames would be called with the maven project as argument instead of the containing folder. These changes should fix that.

The accompanying issue is JENKINS-22196.

Wilco