Deliver circuit handshake counts as part of the heartbeat

Previously, they went out once an hour, unconditionally.

Fixes 10485; bugfix on 0.2.4.17-rc.
Merge branch 'bug10485_024' into maint-0.2.4
Add a missing include