FLASH_Update-Erase Flash pages for failure and return next_chunk_index