Don't serve gwtjsonrpc endpoints if GWT UI isn't enabled

The old-style RPC endpoints are not a public interface and practically
speaking can't really be used except by GWT code; there's no point in
serving them if there is no GWT UI.

Change-Id: I5abe6ca48448d6eca3f47dbaf681c1553e637203
diff --git a/java/com/google/gerrit/httpd/WebModule.java b/java/com/google/gerrit/httpd/WebModule.java
index 538d605..d115f43 100644
--- a/java/com/google/gerrit/httpd/WebModule.java
+++ b/java/com/google/gerrit/httpd/WebModule.java
@@ -56,7 +56,9 @@
     installAuthModule();
     if (options.enableMasterFeatures()) {
       install(new UrlModule(options, authConfig));
-      install(new UiRpcModule());
+      if (options.enableGwtUi()) {
+        install(new UiRpcModule());
+      }
     }
     install(new GerritRequestModule());
     install(new GitOverHttpServlet.Module(options.enableMasterFeatures()));