Since the aura window will last as long as the X server with xephyr, it's better to query the aura window ID at the start and then just compare against that.  See croutonwheel.