client: prevent double-close