[JENKINS-19418] Fix random HTTP 404 when viewing build details

Added a unit test (and supporting localExpiredBuilder) to expose a
defect in the search() method of AbstractLazyLoadRunMap whereby the
index contained an entry for the requested build number, but the
BuildReference's referent was null.
Fixed the search() method to handle this rare[ish] corner case.

(cherry picked from commit 7c9aab3831e3df9f30585473e265efa8e2519537)
[JENKINS-19418] Minor formatting fixes.

(cherry picked from commit d12b16c66b6cb2e382321f7bafb653c027931b1a)