avoid possible crash in debug code
do not leave fake build jobs in gantt view forever

If the Gantt view saw only end of a job but not the beginning, it
mistakenly added it as a new job.