Fix race condition in which client starts before server is ready.