[Fix] Cleanup emu environment items on exit.
Remove unused define in emu_msvcrt.
Free allocated CTimeSmoother at exit.
[AE] Free AVIOContext and its buffer.
Merge pull request #4944 from ace20022/memleaks

[RFC] Fix memleaks