client: set ctx->state to a safe state when reinit fails