Revert "Make sure active tool is deactivated before closing the document"
This reverts commit 45bdec0ecd0b48fcc423d91e42ca49e8acd2a177.