avcodec/mjpeg_parser: Make parser a bit more robust with unclean input