Properly check for the WM_DELETE_WINDOW atom

I don't know if you want to merge this or do it in a merge with qtile/develop

cffi analog of qtile/qtile#464