Fix NPE: getBuilds() should check that .getItem() does not return null

e.g. when someone updates the config.xml directly with invalid `projectName`.
There is actually one further check that should be done: that the named item not only exists, but is an `AbstractProject`! This is best handled by passing `AbstractProject.class` to the call to `getItem`, which has the happy effect of removing the need for the cast.