set thread id using the new callback API of openssl
simplify locking callback code

lock_count doesn't seem to be needed, so get rid of it