- Pass the exit code back from WM_main_playanim instead of calling exit.
- Errors are printed to the stderr.
- Resolve some leaks on exit.
Note that this addresses noisy leaks reported by ASAN which were
flooding the output, but doesn't attempt to address all leaks.