Allow nssdb directory to be set, better concurrency

Used the pattern to lock during init from rust-ssl.