bugfix: modified state is reset even when saving fails + more tests

DocumentHandlerTest tests if modified state is reset

(0) -10 -2 +2 tip

mercurial