#3942: Added context storage in TLS for x86 wrappers
#3942: modified tests
#3942: fixes