Satisfy ISO C warnings for --enable-picky

Also, add peer->cookie and random() to use for tie-breakers.