:art: Avoid creating empty ocr-texts.json when OCR is disabled (#16597)
- Skip file creation when OCR is disabled, file doesn't exist, and assetsTexts is empty
- Fix potential deadlock by releasing lock when marshal fails
authored by