Adapt to current Gerrit plugin API

The plugin no longer compiled against current gerrit master.

* OutgoingEmail is final and now delegates custom behavior to an
  EmailDecorator. Turn RateLimitReachedSender into a decorator and
  use EmailFactories to create the outgoing message, matching core
  and the checks plugin. Header, message id and recipient setup move
  to init(OutgoingEmail), the recipient check moves to
  shouldSendMessage(), and formatting moves to populateEmailContent().

  The plugin-owned Soy templates are still rendered by the plugin,
  now with an explicit data map for email.userNameEmail and
  email.log instead of the removed protected soyContext. Add focused
  sender tests for the factory path, header/message-id/recipient
  setup, group gating, and text/HTML rendering.

* PluginCommandModule requires the plugin name at construction;
  inject it via @PluginName.

* Error Prone rejects the impossible null comparison in
  UserResolver.getUserName(); use flatMap over the optional user
  name instead. The discarded cloneProject() return values in
  RateLimitUploadPackIT are assigned to an unused variable to satisfy
  CheckReturnValue.

Test Plan:
bazelisk build //plugins/rate-limiter
bazelisk test --cache_test_results=NO \
  //plugins/rate-limiter:rate-limiter_tests

Change-Id: If3b8a90c25e17d64f5c1e8a2047b9de6315a7f28
5 files changed