Check for missing undo files at startup, making the check somewhat more ...

...efficient.

This is also an incremental step in making an index pruner for #4481
Why the map and bool? Just a set for both suffices.