So now there are two different suggestions how to deal with this issue. For obvious reasons I feel uncomfortable poking around in TLS-related code--even though we already carry a patch for openssl.c.
I think I am going to go with a third alternative and take this issue as a reason for replacing heirloom-mailx with the s-nail fork[1] which has actually seen some upstream development in the last 5 years. Cheers, -Hilko