avcodec/mjpegdec: Check for end for both bytes in unescaping