Also write the failed metadata when using an old metadata cache

Load the old file at startup, append to it if new applications are found and
remove any fixed applications that are now valid.