bind: fixes for openssl 1.1.0 thread compatibility