Crash fixes (spectator mode); other fixes

Various (crash) fixes, full description in commit notes:
- auto_save fix when debug_session
- Spectator mode: Can no longer reward a unit, which would crash the game
- Spectator mode: Can no longer capture a building, which would crash the game.
- Weapons no longer have hidden buttons (such as the Build button) after first having a human unit selected.
  Also: the 'Return to Camp' button is now visible on weapons as well!
- No more (useless) rewarding of weapons

Other:
- Added macro DYNARRAY_DEBUG_ELEMENT_ACCESS to aid in debugging.