CCBC-430: Provide openssl locking callbacks

This will install lock callbacks for SSL, but only if they aren't there
already -- to prevent clobbering another library's handlers.

Change-Id: I2defd2666f6536f1f3b13756535abaa3cef7f2d8
Reviewed-on: http://review.couchbase.org/39202
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>