Only install RestModule if brokerApiEnabled

The RestModule is only used for brokerApiEnabled.
When trying to run events-rabbitmq with "brokerApiEnabled=false" the
plugin will fail to start.

Change-Id: Id0632beec268f0c43dc894a88cff9c7321cdf11e
diff --git a/src/main/java/com/googlesource/gerrit/plugins/rabbitmq/Module.java b/src/main/java/com/googlesource/gerrit/plugins/rabbitmq/Module.java
index 6b40a13..a44c2a4 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/rabbitmq/Module.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/rabbitmq/Module.java
@@ -117,7 +117,6 @@
         new FactoryModuleBuilder()
             .implement(EventWorker.class, UserEventWorker.class)
             .build(EventWorkerFactory.class));
-    install(new RestModule());
     bind(SubscriberSession.Factory.class)
         .to(SubscriberSessionFactoryImpl.class)
         .in(Singleton.class);
@@ -133,6 +132,7 @@
 
     if (brokerApiEnabled) {
       install(rabbitMqBrokerApiModule);
+      install(new RestModule());
     } else {
       logger.atInfo().log(
           "The RabbitMqBrokerApi is disabled, set enableBrokerApi to true if you want to enable"