Made function of sc-hsm-pkcs11-test thread safe.

Add CRT debug for windows to sc-hsm-pkcs11-test and sc-hsm-ultrulite-test.