Refactor quitting Inkscape.
Uses existing code to handle quitting Inkscape by calling InkscapeApplication::destroy_all(). This function calls InkscapeApplication::destroy_window() for all Inkscape windows which verifies that data is not lost when window is closed, deletes document if document not part tied to another Inkscape window, and if it is the last Inkscape window, saves dialog positions before deleting dialogs.
Additional minor code cleanup.