Fix reparenting bug for applications the map/unmap their windows
multiple times in rapid succession