Keep stored snapshots for targets skipped due to other targets failing

When a target fails and the execution of scheduled build is stopped, the
stored snapshot for any targets that haven’t been (re)built was not saved
back to the metadata file. This was mostly random due to the hash table
(set) used to enumerate the scheduled targets.

Now combine the current snapshots with the stored ones prior to writing
them, so not to accidentally discard any even if we never got to
(re)build them.

Not discovered earlier due to the more frequent usage of --keep-going.