dt_imageio_export_with_flags(): do not leak memory upon error.
Fixes Coverity CID 1260259