Stop valgrind bot from crashing

make_surface is returning nullptr, resulting in an invalid read.

Add an error message with debugging information and skip this
iteration.

Also switch to cleaner for loop syntax.

BUG=skia:5282
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1959173002

Review-Url: https://codereview.chromium.org/1959173002
1 file changed