I am familiar with browser.tabs.closeWindowWithLastTab, but that setting protects the window rather than the running application. When running firefox in an ephemeral container as I often do, Ctrl+W quits the the application if there is only one tab...