Repurpose `main_quit` as the main exit-point

* Move old main_quit() contents to new local main_finalize() function
* Move non-callback exiting code from callbacks.c to main_quit()
* Use main_quit() everywhere that was using on_exit_clicked as a normal
  function, and make on_exit_clicked to directly call main_quit()
  itself.