Keep information about all block files in memory

As preparation for a version of #4701 that keeps track of the size of data on disk.
I wonder; do we need this (conditional) resize in three places, or could we replace it with an assert in some of the places because encountering a new block file would be unexpected?