Check return value from Dart_PostCObject() in sample extension
Check return value from Dart_PostCObject() in sample extension

Improve the sample code to check Dart_PostCobject(). It prevents
possible VM hangs when users sent invalid messages and add error
messages.

Bug: https://github.com/dart-lang/sdk/issues/35647
Change-Id: Ib0e752c063b0f6c14385de06000f6195c3caf530
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98743
Commit-Queue: Zichang Guo <d26af3001798f91912fb1504666bca93c093d553@google.com>
Reviewed-by: Siva Annamalai <2e618a8cbd7bb6b3d4409061ae407d692a098546@google.com>

dart-archive/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk