Re-do a cast in order to make old buggy freebsd gcc happy

Fix for #9254.  Bugfix on 0.2.4.14-alpha.

This is not actually a bug in the Tor code.
Merge remote-tracking branch 'origin/maint-0.2.4'