Fix segfault when saving cover image to file

The metadata copies the pointer rather than the underlying object.