[vm/compiler] Do not notify observers if we failed to create code.
[vm/compiler] Do not notify observers if we failed to create code.

CodeObservers don't expect to be notified with `null` code object.

Change-Id: I4ebbe021f827faf9e01b5b3c3734470433e14787
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152803
Reviewed-by: Martin Kustermann <a35dd5b79fac84b2bb3b026a16b8becc55af5961@google.com>
Commit-Queue: Vyacheslav Egorov <72c81f38df725d8f1832acb9b5bb99563fc2f1b9@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