Fixes for two crash bugs.

- Fixes sound-related regression causing a crash inside stop_foley_sound.
- Fix for out-of-bounds thing id in level 16 end cog.