avcodec/mjpegdec: check for malloc failure of blocks[] and last_nnz[]