[bitcoin/bitcoin] functional tests fail —with-sanitizers=undefined (#14059)

Steps to reproduce on master and 0.17:

«`sh
git checkout bitcoin/master && make distclean
./configure —with-sanitizers=undefined CC=clang CXX=clang++
make -j 16 check && ./test/functional/test_runner.py -j 16
«`

Runs into some divide by zero and other issues…