Fixed memory leak.

This changes fix a memory leak when the call is redirected to the DrawToHdc, that will return without freeing the memory allocated with Marshal.AllocHGlobal (line 506)