Minimize use of ReviewDb when not needed

When all changes have been migrated to NoteDb, do not open ReviewDb
anymore. Opening ReviewDb when not needed would only cause more
contention on the DB Pool and cause problems to the active threads.

The only point where we need to "mimic" a minimum of functionality
is when a ChangeNote is retrieved: just return a null element so
that Gerrit can get the entire data from the Git repository, avoiding
stale indexing.

Bug: Issue 9302
Change-Id: I8b0ba81ef16c546852c0d93f27bb8abb46c034f9
5 files changed