[autotest] Bug filer follows merged issues.

Currently if one of the automatically filed bugs is marked as
'Duplicate' and merged into another issue, a new issue about the repeated
failure will be filed again. This is because 'Duplicate' issues
is recognized as 'closed' issues and our bug filer doesn't update
a closed issue.

The fix is that, if an issue is merged into another issue,
we will update the parent issue if it is open.
If there is a chain of parent issues, the bug filer will follow
the chain until it finds the original one that is open.

BUG=chromium:221602
TEST=Manually create two issues in the bug tracker, with one merged into
the other, file a bug and confirm that we are updating the second one;
Test the case where we have a chain of duplicated issues; Test
the case where a bug is marked as 'Duplicate' but has no 'mergedInto' field;
Test the case where the duplicated issues form a circle; Test
with dummy suite;reporting_unittest.

Change-Id: Ib7cbd533a7533579add5d0b14270a45d501f27d1
Reviewed-on: https://chromium-review.googlesource.com/66288
Reviewed-by: Fang Deng <fdeng@chromium.org>
Tested-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Fang Deng <fdeng@chromium.org>
4 files changed