Fix duplicate entries in all plugins list

Also:
- Fixed plugins that error in their cleanup function not actually being disabled and causing varying degrees of havoc.
- Tweaked the look of window close buttons so they look less out of place.
- Added some validity checks to some SGUI controls to make sure they're dealing with valid objects.