Allow the node to run with history pruned.

To avoid stalling the downloads of other peers, we disconnect those
who ask us for a block we don't have anymore.
chainActive is initialized at the end of this function. Just move the test down.