Core: Dispose object handles when no longer needed

Since these object instances internally inherit from IDisposable, they should be disposed. Especially so for graphics drawing, since it frees up GDI handles.