QTiffHandler: Extract Method Private::readNextImage() from read()
This allows to centralize the Private::close() call in read(), instead
of having every early return execute it manually, which one return
already forgot (fixed in a prequel commit).
I also considered simply adding a qScopeGuard([&] { d->close(); }),
but a traditional Extract Method seemed more productive, as it reduces
the size of the already-large function and separates concerns, instead
of adding another few lines, and leaving concerns entangled.
Amends the addition of the TIFF plugin to qtimageformats, from qtbase
(5.0), but made more urgent by adding support for more and more
formats over time.
Pick-to: 6.12 6.11 6.8
Change-Id: I641103b2a2e2f22340066802d64d286d8242fde2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>