fix issue when window is destroyed while moving/resizing it