Fixes issue #1316 (Ghost windows)

I put #ebbes fix as mentioned on #1316 and all seems to work well.
I was using last version of Cinnamon (2.0.3) and some windows that closed too fast remained as ghost on top of everything and the only way to get rid of them was by cinnamon --replace command (very annoying)