Fix File -> Revert to work with new Undo/Redo engine

This commit required the creation of an "Undo to specific stack
position" function, and it works *brilliantly*.  Based on this, I am now
confident that PD can support a full-featured History browser.
Reset base layer settings after Flatten Image

Without this fix, if the base layer of the image had weird settings
(like non-destructive resizing active), the flattened image would assume
those parameters.  Oops!