Use MockWebServerRule in more tests.

Also fix a bug in MockWebServer where calls to shutdown()
raced with calls to play() would throw a NullPointerException.

Also improve logging in MockWebServer.