lib/igt_fb: Add igt_put_cairo_ctx as counter to igt_get_cairo_ctx

This will allow support for NV12 in the future, where igt_get_cairo_ctx
will return a RGB image to draw with, which will be converted in
igt_put_cairo_ctx so tests don't have to add special support for NV12.

This is the same as cairo_destroy + checking for errors, but not all
tests use this correctly so it's better to have a single handler for it.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
diff --git a/tests/kms_concurrent.c b/tests/kms_concurrent.c
index 3b2e601..283acf8 100644
--- a/tests/kms_concurrent.c
+++ b/tests/kms_concurrent.c
@@ -148,8 +148,7 @@
 				rect_w[i], rect_h[i], 0.0, 0.0, 0.0);
 	}
 
-	igt_assert(cairo_status(cr) == 0);
-	cairo_destroy(cr);
+	igt_put_cairo_ctx(data->drm_fd, &data->fb[primary->index], cr);
 }
 
 static void