mp_image: check for malloc failure

Or rather, the only reason av_buffer_create() can fail is a malloc
failure.
vd_lavc: fix error handling path

The ctx->pic check must uninitialize the decoder.