cairo_surface_create_similar_image is available from Cairo 1.12 upwards, added compatibility code for earlier versions