Fix race with HTTP client in tests. (@Hodgestar)