Before this fix, an error used to show up in the UI upon submitting a
change or commit that was referred-to by a branch. Such a branch may
exist if either directly pushed or created directly in the repository.
Add a corresponding test to SubmitByRebaseIfNecessaryIT. Purpose of the
test being, to exercise this specific /fixed case with the necessary
coverage. Hence testing this by using two changes with the branch
referring to the second (tip) change. Having the branch referring to the
first (parent) change instead does not trigger that error.
Add reusable helper methods to AbstractDaemonTest and AbstractSubmit, to
first serve that new test.
Bug: Issue 4087
Change-Id: Id01a3cabcd5bd58e562d3d7e7879e7905df6ca19