Fixed intermittent crash on exit.
Quitting from menu, window button, and cmd-q all work correctly now.