In case of OSX jemalloc register itself as a default zone allocator.
But when you link statically then zone_register() will not be called,
and even will be optimized out:
$ nm clickhouse.patched | grep -c zone_register
0
Fix this, by manually calling it.
v2: extern C