tests: Add write_surface_as_png() helper
tests: Add write_surface_as_png() helper

And use the helper routine for generating the output filename.

Signed-off-by: Bryce Harrington <bdb14cfc1ab8d24e13de84adc40b41ae60c13bd1@osg.samsung.com>
Reviewed-By: Derek Foreman <2f97e0f0bc172406aab8ccd42dab54c95bab8759@osg.samsung.com>

eyolfson/weston,sir-murray/weston,jonnylamb/weston,Fantu/compositor-spice,sir-murray/weston,udoprog/weston,xorgy/weston,jonnylamb/weston,Tarnyko/weston-xdg_surface_present,xorgy/weston,Tarnyko/weston-xdg_surface_present,mchalupa/weston,Fantu/compositor-spice,mchalupa/weston,krezovic/weston,kwm81/weston,Fantu/compositor-spice,kwm81/weston,eyolfson/weston,giucam/weston,giucam/weston,Gnurou/weston,krezovic/weston,Gnurou/weston,udoprog/weston