Don't check if the job exists if we are going to ignore the result

Now that we're lazy loading builds, calling getBuildByNumber is not cheap.
So evaluate the 'ignore' flag before trying to load the build.
Merge pull request #689 from justinsb/perf_lazyload_getdependencychanges

Don't check if the job exists if we are going to ignore the result
Noting #689.
Observed an NPE printed during shutdown.
Observed repeated NPEs printed during shutdown.
java.lang.NullPointerException
	at hudson.model.listeners.RunListener.all(RunListener.java:216)
	at hudson.model.listeners.RunListener.fireFinalized(RunListener.java:196)
	…
Added testcase for [JENKINS-16499]
[FIXED JENKINS-16499] Assuming that:
- save() is not strictly necessary here. config.xml might be saved later or not - doesn't really matter
- this else branch should only be entered when migrating from very old Hudson instances
Changelog and fixed test for [JENKINS-16499]
[FIXED JENKINS-16554] Restored Java 5 compatibility by downgrading to commons codec 1.6