Shuffle sanity checks into preliminary_checks().

This refactoring helps pave the way for online indexes-only
repacking. Patch by Beena Emerson.