app: check for invalid offsets when loading XCF files
More safety checks for detecting broken xcf files, also based on examining issue #8230. After reading an offset where layer, channel, etc. data is stored, we add a check to make sure that offset is not before where we read the offset value. Because the data is always written after the offset that points to it.