Fix some resource leaks/memory leaks.
Fix release() in StdMutex.h

Originally fixed here:

https://code.google.com/p/dolphin-emu/source/detail?spec=svn74a5ad542b44a18751acc19e4d1229d640cc4c0f&r=4f4aa4860df98f401384f6e598cb649b13882e79
Get rid of unused iterators.
Merge pull request #496 from lioncash/master

Memory leak cleanup. Fixing some small things that were fixed in the Dolphin source, but didn't make it over here.