Add missing includes and namespaces.
Remove SSL context caching.

OpenSSL uses reference counting for contextes, so the caching is rendundant.

Also add SSL closing method.
RAY specific build modifications.