Fix rasterize example exit status on failure

Fixes #11911 and #11907.