Fixes #7246
First commit adds a helper I found useful to conclusively debugging this particular issue, but I can drop the commit if we don't want this for some reason.
The second commit addresses the race condition in sendheaders.py.
Clear the last block announcement before mining new blocks.
ut ACK
utACK, thanks!