ERR_remove_thread_state doesn't do anything in OpenSSL 1.1.x. It is possible that this needs to be reviewed for Windows, but this is the wrong place to do thread cleanup on Windows