The truth is...you don't. As I understand it, on both iOS and Android, you are not supposed to actually close the apps. Rather, the user/system handles it. The user can easily use the home button, etc... to switch to other things, and then over time, either they will close the app manually, or the OS will do it. That's actually part of the rules of those OS's and is why game_end() doesn't work there. The
manual page explains what happens, though it doesn't actually explain the reasons behind it. I'm sure a google search, or even a search on these forums, will lead to better answers, as I've seen this topic come up before.