Reapply "gui: Do not exit and re-enter main event loop during shutdown"
Summary:
Un-revert D18150 + apply a bugfix for a MacOS crash on shutdown:
qt: Override BitcoinApplication::event() to handle QEvent::Quit
#336 introduced a regression when termination requests from a platform are not handled properly.
This PR fixes this regression. On macOS shutdown after clicking "Quit" in Dock icon menu, and during logout works again.
This concludes backport of core-gui#336 and core-gui#547
Test Plan: test plan of D18150 + run bitcoin-qt on MacOS
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D18170