pkcs11: Added support for locking in multithreading applications
tests: Added thread safety and threading tests to sc-hsm-pkcs11-test
pkcs11: Added mutex lock to C_Logout