Fix crash on exit due to floating windows