Dwarf Fortress won't close when you QUIT (in-game) nor with ALT F4 nor any other way.
Thank you for the bug report! If an application does not quit when instructed to, please report it to the developers of that application. You can also use system monitor to end the application's process. Plasma will offer this on its own when the application has become unresponsive, but not in the general case, as this may lead to data loss.