cpp/capi.cpp: fix ImageProvider leak

GoImageProvider had a memory leak where it got a pointer to a QImage,
and never freed it. Qt already has a refcounting system in place so every
QImage is actually a pointer to pixel data, but it relies on the destructor
for every QImage instance to be called.