The goal of the test is to check the stalling timeout, not the block download timeout. On extremely slow hardware (for example qemu virtual hardware), downloading the 1023 blocks may take longer than the block download timeout. Fix it by pinning the time using mocktime, and only advance it when testing the stalling timeout.
Backport of core#30705.