[avalanche] Use black magic for popcount.
Summary:
Or compiler intrinsic if these are supported.
The black magic algorithm is from 'Owen Anderson <resistor@mac.com>', as far as I know.
Test Plan:
make check
Reviewers: #bitcoin_abc, jasonbcox, Fabien, Mengerian
Reviewed By: #bitcoin_abc, jasonbcox, Fabien, Mengerian
Subscribers: Mengerian, jasonbcox, teamcity, schancel
Differential Revision: https://reviews.bitcoinabc.org/D2148