Skip non-existing builds when collecting build numbers.

This should collect the build numbers to present to the user (up to the job specific number of previous builds), but skipping non-existing builds (different from failed builds!). This issue became obvious with the latest server crash.

@mkalb I'd appreciate a short review. Did I miss something?