Add a safety check to analyzer messages codegen.
Add a safety check to analyzer messages codegen.

Previously, if the user added an `index` field to a message but failed
to add an `analyzerCode` field, code generation would just silently
ignore the index.  This was error prone.  Changed to report
`invalidAnalyzerCode`, which is the same error we report if the
analyzer code is improperly formatted.

Change-Id: I37de06058cd1938af2c9ef506412dc7960986269
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158402
Reviewed-by: Konstantin Shcheglov <09e4d7516628963212bf4aace2f97603d2b706e4@google.com>
Commit-Queue: Paul Berry <72d414e3a99fb120308437779d51667bcc0984eb@google.com>

dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk