AVIFormat: fix caching logic

The AVIFormat was not thorough in its cache checking, looking only for
matching plane indices. However, if a subregion of a plane was opened,
the cached plane could potentially "match" but be incorrect - resulting
in overlay artifacts.

All cached plane checking will now check the dimensions of the data that
was read into the cached plane as well, and if a smaller region was
requested the entire plane will need to be re-read.