Use window-deletable-p
Merge pull request #357 from sabof/more-accurate-deletion-test

* prevent occasional errors when windows are deleted