Handle exception thrown when the diff margin is updating when the editor...

... is closed (fixes #112)