Fix some memory leaks

I've been running openxcom through Clang with AddressSanitizer and LeakSanitizer and I'm trying to fix a couple of memory leaks and errors along the way.

This pull request is the first batch.