Switch to OpenSSL::Digest which is threadsafe on 2.1.2

This fixes the following error:

  Digest::Base cannot be directly inherited in Ruby (RuntimeError)

Fixes #334