Fix memory leak of SubIndex.NrtFuture objects

The SubIndex.NrtFuture objects are added as listeners of
searchManager who was found to hold on to them forever.

Fixed. There are also some code refactoring in NrtFuture.

Change-Id: If87cb62890a1cfa6c6336f6c7953a1cb56d42937
Fix: The email notification of review comments gets stuck.

Sometimes it is found that one thread goes stuck when waiting
for an answer from the SMTP server.

Fixed. Enable user to

 -config the timeout value of opening a socket connected to a remote
  SMTP server.

 -config the worker-thread pool size of executor used for sending out
  review comments notification when it is not enough to dedicate only
  one thread.

 -config the default size of the background execution thread pool when
  one thread is not enough to handle miscellaneous tasks including
  sending out every kind email notification.

Change-Id: Id8177b374f7049cfac617c50e66b2c83ae71641b
Fix ChangeListener auto-registered implementations

Add missing @ExtensionPoint in ChangeListener so implementors can use
@Listen to register.

Change-Id: Ia7fd16a7afdffbfc278880317fd10297f8b9e19d
(cherry picked from commit eff0592a70ce7fb3dee91abd5262dd462339591e)
Emit ref-updated event when editing project access via web UI

3daa739e13 took care of firing the ref-updated event for updates via the
web UI access pane, but not changes via the web UI general pane, which
uses the REST 'PUT /projects/:project-name/config' endpoint. This commit
takes care of that case, as well as the REST
'PUT /projects/:project-name/description' endpoint.

Note: there's still no ref-updated event for the case of changing a
project from "hidden" state back to read-only or "active" as hooks are
suppressed for hidden projects deeper in the code.

Bug: Issue 2571
Change-Id: I0a260011c0968193ccb5900a18935e654d25f042
Merge "Fix memory leak of SubIndex.NrtFuture objects" into stable-2.8
Correct Javadoc of RestReadView in extension API

The resource parameter specifies the resource to be read,
not the resource to be modified.

Change-Id: I4010674a348cefad02c234118ff25cf332dd76b4