Add thread_pool implementation.
Add threading support for encryption.
Use shared_ptr for session key.
Forgot during merge.
Contexts are not thread-safe themselves.