Remove useless code.
Properly terminate threads when the game activity exits.