improve test for index extension truncation

Both `buffer_size` and `total_size` are unsigned and we currently compare `buffer_size` (the length of the remaining buffer) to `total_size` (the size that we need to consume from the index to fill in this extension - the advertised length plus the length of the extension header) but when `buffer_size < total_size`, it will very rarely be true that `buffer_size - total_size < INDEX_FOOTER_SIZE`.  We should instead test that explicitly.