qt: write_shortcuts() segfault on quit
First noticed with Qt6 in #41675 but now that I checked, it happens with Qt5 too. There's a segfault in write_shortcuts():
Thread 1 "freeciv-qt" received signal SIGSEGV, Segmentation fault.
write_shortcuts () at ../../../../src/client/gui-qt/shortcuts.cpp:792
792 s.setValue("id", sc->id);
Happens when quitting immediately from the start menu, but the one time I went to game there was no segfault.