Require cmd+Q to be held for a couple of seconds before quitting on macOS. This is how it works in Chrome, and I think it should be the norm for all tab-based apps. With the Q key being right next to the W key, it's very easy to accidentally press Q ...