maintner: mark an issue as NotExist when its comments are gone
maintner: mark an issue as NotExist when its comments are gone

When synchronizing comments of an issue, getting a 404 (or 410) from
GitHub REST API's list comments endpoint should happen if and only if
the issue no longer exists. Use that as a safe opportunity to append
a mutation to the log that updates the issue's NotExist field to true.

Maintner doesn't yet have complete support for transferred issues,
a feature that GitHub added after its initial design. It's been
difficult to add it retroactively as described in go.dev/issue/37603.

This change aims to make a small incremental change that we can feel
confident about applying and watching closely, and doesn't try to
implement a complete fix. It should help get maintner unstuck when
trying to sync comments in an issue tracker that has a transferred
issue, and incurs a minimal risk of writing bad mutations.

This CL is based on past work in CL 161521 and CL 176638,
but is smaller in scope intentionally.

For golang/go#37370.
For golang/go#40640.
Updates golang/go#45461.
Fixes golang/go#52017.

Change-Id: I3702d3c7b2e412cf75809fdb722c0ee693c8600e
Reviewed-on: https://go-review.googlesource.com/c/build/+/397234
Trust: Dmitri Shuralyov <d181b7fea0ec87c86ba5a890ab716db52498e3ba@golang.org>
Reviewed-by: Heschi Kreinick <e89ab2b172855aa0ad01c40c4d8a3535a61ac68a@google.com>

golang/build,golang/build,golang/build,golang/build