Fix deadlock in client.go