Fix crash upon history navigation when a document with history is deleted

Fix case 563013
make sure we trigger OnHistoryChanged events (changed would never be true)