Fix potential memory leak of two pointers (xwayland and client)