d2d: use handlePaintEvent without crash(lock EndDraw())