Fix potential segfaults in unload_game.