fix gdi_resize: set primary_buffer to NULL to avoid use after free